Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6977965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:41:39+00:00 2026-05-27T17:41:39+00:00

I am using Core-Plot library to draw bar chart in iPhone. I am using

  • 0

I am using Core-Plot library to draw bar chart in iPhone. I am using CPTTestApp-iPhone to my training. In my project the bar appear very good thats looks like from the sample project. But, i dont where i need to give the values to draw the bars. Then, in my actual project i need to change the bar values dynamically. How can i do this? Please help me to find out the solution. Thanks in advance. Below the sample datasource code,

#pragma mark -
#pragma mark Plot Data Source Methods

-(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot 
{
    return 10;
}

-(NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index 
{
    NSDecimalNumber *num = nil;
    if ( [plot isKindOfClass:[CPTBarPlot class]] ) 
    {
        switch ( fieldEnum ) 
        {
            case CPTBarPlotFieldBarLocation:
                num = (NSDecimalNumber *)[NSDecimalNumber numberWithUnsignedInteger:index];
                break;
            case CPTBarPlotFieldBarTip:
                num = (NSDecimalNumber *)[NSDecimalNumber numberWithUnsignedInteger:(index+1)*(index+1)];
                if ( [plot.identifier isEqual:@"Bar Plot 2"] ) 
                    num = [num decimalNumberBySubtracting:[NSDecimalNumber decimalNumberWithString:@"10"]];//10
                break;
        }
    }

    return num;
}

-(CPTFill *) barFillForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSNumber *)index; 
{
    return nil;
}

How to increment the bar length in coreplot iPhone? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:41:40+00:00Added an answer on May 27, 2026 at 5:41 pm

    A Core Plot plot will request its data from the datasource when it is first displayed. You can force it to load new data in several ways:

    1. Call -reloadData on the graph to reload all plots.
    2. Call -reloadData on the plot to reload all of the data for only that plot.
    3. Call -reloadDataInIndexRange: on the plot to reload a range of data indices without changing the total number of data points.
    4. Call -insertDataAtIndex:numberOfRecords: to insert new data at the given index. Any data at higher indices will be moved to make room. Only the new data will be requested from the datasource.

    You can also remove data from the plot without reloading anything by using the -deleteDataInIndexRange: method.

    As the name implies, the -numberOfRecordsForPlot: method tells the plot how many data points will be plotted. The -numberForPlot:field:recordIndex: method will be called to load the actual data values. It gets called for each combination of field (location and tip) and data index.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using core-plot library to draw a bar-chart on my iPhone application and
In iPhone App i am using core Plot vertical bar chart. How to Remove
i am trying to draw bar chart for my app using core plot as
I'm using core plot to draw a bar chart, I was wondering is there
I am using Core-plot to plot vertical bar chart. In that is it possible
I have to draw 3D pie chart in ipad using core-plot API .how can
How to zoom in and out a pie chart in iPhone using core-plot? Any
I have slider in one view and Bar chart using core plot in its
i am using core plot to draw pie chart and following text Error 10
Im using core-plot for my graphing component of my iPhone app, and I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.