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 875227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:14:03+00:00 2026-05-15T11:14:03+00:00

I try to plot a Bar Chart with Core-Plot with an Array (content are

  • 0

I try to plot a Bar Chart with Core-Plot with an Array (content are NSIntegers) given one view before.
After transfering the Array in an NSInteger, i must convert it into a NSDecimalNumber, and in this process, my NSInteger (for example 45) becomes “60900224”…

Here’s the code extract:

-(NSNumber *)numberForPlot:(CPPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index 
{ NSInteger *values = [Werte objectAtIndex:index];
    NSDecimalNumber *num = nil;
    if ( [plot isKindOfClass:[CPBarPlot class]] ) {
        switch ( fieldEnum ) {
            case CPBarPlotFieldBarLocation:
                num = (NSDecimalNumber *)[NSDecimalNumber numberWithUnsignedInteger:index];
                break;
            case CPBarPlotFieldBarLength:
                //num = (NSDecimalNumber *)[NSDecimalNumber numberWithUnsignedInteger:(index+1)*(index+1)];
                num = [NSNumber numberWithInt:values];
                if ( [plot.identifier isEqual:@"Bar Plot 2"] ) 
                    num = [num decimalNumberBySubtracting:[NSDecimalNumber decimalNumberWithString:@"10"]];
                break;
        }

    }
    return num;
}

Thanks for help!!

  • 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-15T11:14:03+00:00Added an answer on May 15, 2026 at 11:14 am

    NSInteger is not an object type and can’t be stored in an NSArray (which your Werte appears to be). You seem to be implicitly converting from a pointer to an integer.

    Instead, you should always put NSNumber objects into the array, and then get NSInteger values out of those via integerValue:

    NSInteger value = [[Werte objectAtIndex:index] integerValue];
    
    • 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
I am trying to follow this tutorial ( Using-core-plot-in-an-iphone-application ). When I try to
I am getting the following error when I try to implement Core-Plot in my
I have a pandas DataFrame and I want to plot a bar chart that
Having installed canvas from here http://www.rforge.net/canvas/files/ I try to plot: > canvas('test.js') > qplot(rnorm(100),
I try to make a plot on gnuplot which has no real range order
I've got stacked bar chart where I want to be able to select individual
I have a dataframe df.all and I'm plotting it in a bar plot with
I have a SSRS 2008 report with a Error Bar chart. It plots dates
While I try to plot histogram in R by defining a set of bins

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.