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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:37:05+00:00 2026-06-08T08:37:05+00:00

Basically, I have this class which I am using to display data in a

  • 0

Basically, I have this class which I am using to display data in a CorePlot bar chart:

#import "BarChartViewController.h"
#import "AppDelegate.h"
#import "Project.h"
#import "Currency.h"
#import "TotalValueCalculator.h"

#define BAR_POSITION @"POSITION"
#define BAR_HEIGHT @"HEIGHT"
#define COLOR @"COLOR"
#define CATEGORY @"CATEGORY"

#define AXIS_START 0

@interface BarChartViewController ()

@end

@implementation BarChartViewController
{
    int count;
}

@synthesize data;
@synthesize graph;
@synthesize hostingView;
@synthesize graphType;

//Finds the maximum value from an array of ints
int findMax (int numbers[], int N){
    int max = numbers[0];
    for (int i = 0; i < N; i++)
        if(max<numbers[i]) max = numbers[i];

    return max;
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {

    }

    return self;
}


- (void) generateBarPlot
{
    //Create host view
    self.hostingView = [[CPTGraphHostingView alloc] 
                        initWithFrame:[[UIScreen mainScreen]bounds]];
    [self.view addSubview:self.hostingView];

    //Create graph and set it as host view's graph
    self.graph = [[CPTXYGraph alloc] initWithFrame:self.hostingView.bounds];
    [self.hostingView setHostedGraph:self.graph];

    //set graph padding and theme
    self.graph.plotAreaFrame.paddingTop = 20.0f;
    self.graph.plotAreaFrame.paddingRight = 20.0f;
    self.graph.plotAreaFrame.paddingBottom = 170.0f;
    self.graph.plotAreaFrame.paddingLeft = 70.0f;
    [self.graph applyTheme:[CPTTheme themeNamed:kCPTDarkGradientTheme]];

    //set axes ranges
    CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace;
    plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(AXIS_START) length:CPTDecimalFromFloat(50)];

    plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:
                        CPTDecimalFromFloat(AXIS_START)
                                                    length:CPTDecimalFromFloat((axisEnd - AXIS_START)+5)];

    CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.graph.axisSet;
    //set axes' title, labels and their text styles
    CPTMutableTextStyle *textStyle = [CPTMutableTextStyle textStyle];
    textStyle.fontName = @"Helvetica";
    textStyle.fontSize = 14;
    textStyle.color = [CPTColor whiteColor];

    if (graphType == @"TotalProject"){
        axisSet.xAxis.title = @"Project Name";
    }
    else if (graphType == @"TotalCategory"){
        axisSet.xAxis.title = @"Category Name";
    }
    else if (graphType == @"TotalCurrency"){
        axisSet.xAxis.title = @"Currency Name";
    }

    else if (graphType == @"DistanceTravelled"){
        axisSet.xAxis.title = @"Project";
    }
    else if (graphType == @"FuelCostProject"){
        axisSet.xAxis.title = @"Project";
    }
    else if (graphType == @"FuelCostCurrency"){
        axisSet.xAxis.title = @"Currency";
    }

    axisSet.yAxis.title = @"Total Value";
    axisSet.xAxis.titleTextStyle = textStyle;
    axisSet.yAxis.titleTextStyle = textStyle;
    axisSet.xAxis.titleOffset = 50.0f;
    axisSet.yAxis.titleOffset = 50.0f;
    axisSet.xAxis.labelTextStyle = textStyle;
    axisSet.xAxis.labelOffset = 3.0f;
    axisSet.yAxis.labelTextStyle = textStyle;
    axisSet.yAxis.labelOffset = 3.0f;
    //set axes' line styles and interval ticks
    CPTMutableLineStyle *lineStyle = [CPTMutableLineStyle lineStyle];
    lineStyle.lineColor = [CPTColor whiteColor];
    lineStyle.lineWidth = 3.0f;
    axisSet.xAxis.axisLineStyle = lineStyle;
    axisSet.yAxis.axisLineStyle = lineStyle;
    axisSet.xAxis.majorTickLineStyle = lineStyle;
    axisSet.yAxis.majorTickLineStyle = lineStyle;
    //Set x axis tick length to 0 as there is no data on the x axis
    axisSet.xAxis.majorIntervalLength = CPTDecimalFromFloat(0.0f);

    if (axisEnd <= 400){
        axisSet.yAxis.majorIntervalLength = CPTDecimalFromFloat(25.0f);
    }
    else if (axisEnd <= 900){
        axisSet.yAxis.majorIntervalLength = CPTDecimalFromFloat(50.0f);
    }
    else if (axisEnd <= 1300){
        axisSet.yAxis.majorIntervalLength = CPTDecimalFromFloat(75.0f);
    }
    else if (axisEnd <= 1800){
        axisSet.yAxis.majorIntervalLength = CPTDecimalFromFloat(100.0f);
    }
    else if (axisEnd <= 2300){
        axisSet.yAxis.majorIntervalLength = CPTDecimalFromFloat(125.0f);
    }
    else if (axisEnd <= 2800){
        axisSet.yAxis.majorIntervalLength = CPTDecimalFromFloat(150.0f);
    }
    else if (axisEnd <= 3300){
        axisSet.yAxis.majorIntervalLength = CPTDecimalFromFloat(175.0f);
    }
    else if (axisEnd <= 3500){
        axisSet.yAxis.majorIntervalLength = CPTDecimalFromFloat(200.0f);
    }
    else {
        axisSet.yAxis.majorIntervalLength = CPTDecimalFromFloat(300.0f);
    }

    axisSet.xAxis.majorTickLength = 7.0f;
    axisSet.yAxis.majorTickLength = 7.0f;
    axisSet.xAxis.minorTickLineStyle = lineStyle;
    axisSet.yAxis.minorTickLineStyle = lineStyle;
    axisSet.xAxis.minorTicksPerInterval = 1;
    axisSet.yAxis.minorTicksPerInterval = 1;
    axisSet.xAxis.minorTickLength = 5.0f;
    axisSet.yAxis.minorTickLength = 5.0f;

    NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    [numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
    [numberFormatter setMaximumFractionDigits:2];
    [numberFormatter setPositiveFormat:@"###0.00"];    
    axisSet.yAxis.labelFormatter = numberFormatter;

    int initialTickLocation = 9;
    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
    NSMutableArray *customTickLocations = [[NSMutableArray alloc] init];
    NSMutableArray *xAxisLabels = [[NSMutableArray alloc] init];

    if (graphType == @"TotalProject"){
        for (int i = 0; i < [appDelegate.projects count]; i++){

            //CHANGE THESE NUMBERS TO CHANGE POSITIONS OF THE LABELS
                [customTickLocations addObject:[NSNumber numberWithInt:initialTickLocation]];
                initialTickLocation = initialTickLocation + 7;
                [xAxisLabels addObject:[[appDelegate.projects objectAtIndex:i] name]];
        }
    }
    else if (graphType == @"TotalCategory"){
        for (int i = 0; i < [appDelegate.categories count]; i++){
            //CHANGE THESE NUMBERS TO CHANGE POSITIONS OF THE LABELS
            [customTickLocations addObject:[NSNumber numberWithInt:initialTickLocation]];
            initialTickLocation = initialTickLocation + 7;
            [xAxisLabels addObject:[[appDelegate.categories objectAtIndex:i] name]];
        }
    }
    else if (graphType == @"TotalCurrency"){
        for (int i = 0; i < [appDelegate.currencies count]; i++){
            //CHANGE THESE NUMBERS TO CHANGE POSITIONS OF THE LABELS
            [customTickLocations addObject:[NSNumber numberWithInt:initialTickLocation]];
            initialTickLocation = initialTickLocation + 7;
            [xAxisLabels addObject:[[appDelegate.currencies objectAtIndex:i] shortName]];
        }
    }

    else if (graphType == @"DistanceTravelled"){
        for (int i = 0; i < [appDelegate.projects count]; i++){
            //CHANGE THESE NUMBERS TO CHANGE POSITIONS OF THE LABELS
            [customTickLocations addObject:[NSNumber numberWithInt:initialTickLocation]];
            initialTickLocation = initialTickLocation + 7;
            [xAxisLabels addObject:[[appDelegate.projects objectAtIndex:i] name]];
        }
    }
    else if (graphType == @"FuelCostProject"){
        for (int i = 0; i < [appDelegate.projects count]; i++){
            //CHANGE THESE NUMBERS TO CHANGE POSITIONS OF THE LABELS
            [customTickLocations addObject:[NSNumber numberWithInt:initialTickLocation]];
            initialTickLocation = initialTickLocation + 7;
            [xAxisLabels addObject:[[appDelegate.projects objectAtIndex:i] name]];
        }
    }
    else if (graphType == @"FuelCostCurrency"){
        for (int i = 0; i < [appDelegate.currencies count]; i++){
            //CHANGE THESE NUMBERS TO CHANGE POSITIONS OF THE LABELS
            [customTickLocations addObject:[NSNumber numberWithInt:initialTickLocation]];
            initialTickLocation = initialTickLocation + 7;
            [xAxisLabels addObject:[[appDelegate.currencies objectAtIndex:i] shortName]];
        }
    }

    axisSet.xAxis.labelRotation = M_PI/4;
    axisSet.xAxis.labelingPolicy = CPTAxisLabelingPolicyNone;

    NSUInteger labelLocation = 0;
    NSMutableArray *customLabels = [NSMutableArray arrayWithCapacity:[xAxisLabels count]];
    for (NSNumber *tickLocation in customTickLocations){
        CPTAxisLabel *newLabel = [[CPTAxisLabel alloc] initWithText:[xAxisLabels objectAtIndex:labelLocation++] textStyle:axisSet.xAxis.labelTextStyle];
        newLabel.tickLocation = [tickLocation decimalValue];
        newLabel.offset = axisSet.xAxis.labelOffset + axisSet.xAxis.majorTickLength;
        newLabel.rotation = M_PI / 4;
        [customLabels addObject:newLabel];
    }
    axisSet.xAxis.axisLabels = [NSSet setWithArray:customLabels];

    // Create bar plot and add it to the graph
    CPTBarPlot *plot = [[CPTBarPlot alloc] init] ;
    plot.dataSource = self;
    plot.delegate = self;
    plot.barWidth = [[NSDecimalNumber decimalNumberWithString:@"5.0"]
                     decimalValue];
    plot.barOffset = [[NSDecimalNumber decimalNumberWithString:@"10.0"]
                      decimalValue];
    plot.barCornerRadius = 5.0;
    // Remove bar outlines
    CPTMutableLineStyle *borderLineStyle = [CPTMutableLineStyle lineStyle];
    borderLineStyle.lineColor = [CPTColor clearColor];
    plot.lineStyle = borderLineStyle;
    // Identifiers are handy if you want multiple plots in one graph
    plot.identifier = @"projectTotals";
    [self.graph addPlot:plot];
}

-(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot
{
    return [self.data count];
}

-(NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index
{
    NSDictionary *bar = [self.data objectAtIndex:index];

    if(fieldEnum == CPTBarPlotFieldBarLocation){
        NSLog(@"Position: %@", [bar valueForKey:BAR_POSITION]);
        return [bar valueForKey:BAR_POSITION];
    }
    else{ 
        NSLog(@"Height: %@", [bar valueForKey:BAR_HEIGHT]);
        return [bar valueForKey:BAR_HEIGHT];
    }

}

-(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index
{

    CPTMutableTextStyle *textStyle = [CPTMutableTextStyle textStyle];
    textStyle.fontName = @"Helvetica";
    textStyle.fontSize = 12;
    textStyle.color = [CPTColor whiteColor];

    NSDictionary *bar = [self.data objectAtIndex:index];
    //Here we want to display the value for that day, not the name of the day
    CPTTextLayer *label = [[CPTTextLayer alloc] initWithText:[NSString stringWithFormat:@"%0.2f", [[bar valueForKey:BAR_HEIGHT] floatValue]]];
    label.textStyle =textStyle;

    return label;

}

-(CPTFill *)barFillForBarPlot:(CPTBarPlot *)barPlot
                  recordIndex:(NSUInteger)index
{
    NSDictionary *bar = [self.data objectAtIndex:index];
    CPTGradient *gradient = [CPTGradient gradientWithBeginningColor:[CPTColor whiteColor]
                                                        endingColor:[bar valueForKey:@"COLOR"]
                                                  beginningPosition:0.0 endingPosition:0.3 ];
    [gradient setGradientType:CPTGradientTypeAxial];
    [gradient setAngle:320.0]; 

    CPTFill *fill = [CPTFill fillWithGradient:gradient];

    return fill;
}

- (void)dealloc
{

}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.data = [NSMutableArray array];

    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
    count = [appDelegate.projects count];
    int catCount = [appDelegate.categories count];
    int currencyCount = [appDelegate.currencies count];

    int bar_heights[count];
    NSString *categories[count];
    int catBar_heights[catCount];
    NSString *catCategories[catCount];
    int currencyBar_heights[currencyCount];
    NSString *currencyCategories[currencyCount];

    if ([graphType isEqualToString:@"TotalProject"])
    {
                for (int i = 0; i < count; i++)
                {
                    TotalValueCalculator *calc = [[TotalValueCalculator alloc] initWithString:[[appDelegate.projects objectAtIndex:i] name]];
                    NSString *totalValueString = [calc compareProject];
                    float totalValue = [totalValueString floatValue];

                    bar_heights[i] = totalValue;
                    NSLog(@"---%0.2f", totalValue);
                    categories[i] = [[appDelegate.projects objectAtIndex:i] name];
                }

                axisEnd = findMax(bar_heights, count) + ((findMax(bar_heights, count)) / 10);

                UIColor *colors[] = {
                    [UIColor colorWithRed:139/255.0 green:198/255.0 blue:63/255.0 alpha:1], 
                    nil};

                for (int i = 0; i < [appDelegate.projects count] ; i++){
                    int position = i*7; //Bars will be 7 pts away from each other
                    float height = bar_heights[i];
                    NSDictionary *bar = [NSDictionary dictionaryWithObjectsAndKeys:
                                         [NSDecimalNumber numberWithFloat:position],BAR_POSITION,
                                         [NSDecimalNumber numberWithFloat:height],BAR_HEIGHT,
                                         colors[0],COLOR,
                                         categories[i],CATEGORY,
                                         nil];
                    NSLog(@"^^^^^^^^^^^^^%@", [NSDecimalNumber numberWithFloat:height]);
                    [self.data addObject:bar];

                }

    }
    else if ([graphType isEqualToString:@"TotalCategory"])
    {
        for (int i = 0; i < catCount; i++)
        {
            TotalValueCalculator *calc = [[TotalValueCalculator alloc] initWithString:[[appDelegate.categories objectAtIndex:i] name]];
            NSString *totalValueString = [calc compareCategory];
            double totalValue = [totalValueString doubleValue];

            catBar_heights[i] = totalValue;
            catCategories[i] = [[appDelegate.categories objectAtIndex:i] name];
        }

        axisEnd = findMax(catBar_heights, catCount) + ((findMax(catBar_heights, catCount)) / 10);

        UIColor *colors[] = {
            [UIColor colorWithRed:236/255.0 green:139/255.0 blue:34/255.0 alpha:1], 
            nil};

        for (int i = 0; i < [appDelegate.categories count] ; i++){
            double position = i*7; //Bars will be 7 pts away from each other
            double height = catBar_heights[i];

            NSDictionary *bar = [NSDictionary dictionaryWithObjectsAndKeys:
                                 [NSNumber numberWithDouble:position],BAR_POSITION,
                                 [NSNumber numberWithDouble:height],BAR_HEIGHT,
                                 colors[0],COLOR,
                                 catCategories[i],CATEGORY,
                                 nil];
            [self.data addObject:bar];

        }

    }
    else if ([graphType isEqualToString:@"TotalCurrency"])
    {

        for (int i = 0; i < currencyCount; i++)
        {
            TotalValueCalculator *calc = [[TotalValueCalculator alloc] initWithString:[[appDelegate.currencies objectAtIndex:i] shortName]];
            NSString *totalValueString = [calc compareCurrency];
            double totalValue = [totalValueString doubleValue];

            currencyBar_heights[i] = totalValue;
            currencyCategories[i] = [[appDelegate.currencies objectAtIndex:i] shortName];
        }

        axisEnd = findMax(currencyBar_heights, currencyCount) + ((findMax(currencyBar_heights, currencyCount)) / 10);

        UIColor *colors[] = {
            [UIColor colorWithRed:236/255.0 green:139/255.0 blue:34/255.0 alpha:1], 
            nil};

        for (int i = 0; i < [appDelegate.currencies count] ; i++){
            double position = i*7; //Bars will be 7 pts away from each other
            double height = currencyBar_heights[i];

            NSDictionary *bar = [NSDictionary dictionaryWithObjectsAndKeys:
                                 [NSNumber numberWithDouble:position],BAR_POSITION,
                                 [NSNumber numberWithDouble:height],BAR_HEIGHT,
                                 colors[0],COLOR,
                                 currencyCategories[i],CATEGORY,
                                 nil];
            [self.data addObject:bar];

        }

    }
    else if ([graphType isEqualToString:@"DistanceTravelled"])
    {

        for (int i = 0; i < count; i++)
        {
            TotalValueCalculator *calc = [[TotalValueCalculator alloc] initWithString:[[appDelegate.projects objectAtIndex:i] name]];
            NSString *totalValueString = [calc compareProjectDistance];
            double totalValue = [totalValueString doubleValue];

            bar_heights[i] = totalValue;
            categories[i] = [[appDelegate.projects objectAtIndex:i] name];
        }

        axisEnd = findMax(bar_heights, count) + ((findMax(bar_heights, count)) / 10);

        UIColor *colors[] = {
            [UIColor colorWithRed:236/255.0 green:139/255.0 blue:34/255.0 alpha:1], 
            nil};

        for (int i = 0; i < [appDelegate.projects count] ; i++){
            double position = i*7; //Bars will be 7 pts away from each other
            double height = bar_heights[i];

            NSDictionary *bar = [NSDictionary dictionaryWithObjectsAndKeys:
                                 [NSNumber numberWithDouble:position],BAR_POSITION,
                                 [NSNumber numberWithDouble:height],BAR_HEIGHT,
                                 colors[0],COLOR,
                                 categories[i],CATEGORY,
                                 nil];
            [self.data addObject:bar];

        }

    }
    else if ([graphType isEqualToString:@"FuelCostProject"])
    {

        for (int i = 0; i < count; i++)
        {
            TotalValueCalculator *calc = [[TotalValueCalculator alloc] initWithString:[[appDelegate.projects objectAtIndex:i] name]];
            NSString *totalValueString = [calc compareProjectFuel];
            double totalValue = [totalValueString doubleValue];

            bar_heights[i] = totalValue;
            categories[i] = [[appDelegate.projects objectAtIndex:i] name];
        }

        axisEnd = findMax(bar_heights, count) + ((findMax(bar_heights, count)) / 10);

        UIColor *colors[] = {
            [UIColor colorWithRed:236/255.0 green:139/255.0 blue:34/255.0 alpha:1], 
            nil};

        for (int i = 0; i < [appDelegate.projects count] ; i++){
            double position = i*7; //Bars will be 7 pts away from each other
            double height = bar_heights[i];

            NSDictionary *bar = [NSDictionary dictionaryWithObjectsAndKeys:
                                 [NSNumber numberWithDouble:position],BAR_POSITION,
                                 [NSNumber numberWithDouble:height],BAR_HEIGHT,
                                 colors[0],COLOR,
                                 categories[i],CATEGORY,
                                 nil];
            [self.data addObject:bar];

        }

    }
    else if ([graphType isEqualToString:@"FuelCostCurrency"])
    {

        for (int i = 0; i < currencyCount; i++)
        {
            TotalValueCalculator *calc = [[TotalValueCalculator alloc] initWithString:[[appDelegate.currencies objectAtIndex:i] shortName]];
            NSString *totalValueString = [calc compareCurrencyFuel];
            double totalValue = [totalValueString doubleValue];

            currencyBar_heights[i] = totalValue;
            currencyCategories[i] = [[appDelegate.currencies objectAtIndex:i] shortName];
        }

        axisEnd = findMax(currencyBar_heights, currencyCount) + ((findMax(currencyBar_heights, currencyCount)) / 10);

        UIColor *colors[] = {
            [UIColor colorWithRed:236/255.0 green:139/255.0 blue:34/255.0 alpha:1], 
            nil};

        for (int i = 0; i < [appDelegate.currencies count] ; i++){
            double position = i*7; //Bars will be 7 pts away from each other
            double height = currencyBar_heights[i];

            NSDictionary *bar = [NSDictionary dictionaryWithObjectsAndKeys:
                                 [NSNumber numberWithDouble:position],BAR_POSITION,
                                 [NSNumber numberWithDouble:height],BAR_HEIGHT,
                                 colors[0],COLOR,
                                 currencyCategories[i],CATEGORY,
                                 nil];
            [self.data addObject:bar];

        }

    }

            [self generateBarPlot];

}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end

I know theres a lot there, but I just can’t figure out for the life of me how I get this bar chart to display float values (for bar heights)? I’ve spent so much time on this now I’m starting to despair.

Does anyone know how to do this? The values that chart is receiving are definitely float values.

Any help at all would be much appreciated..

Thanks a lot,

Jack

  • 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-06-08T08:37:07+00:00Added an answer on June 8, 2026 at 8:37 am

    The bar_heights arrays in -viewDidLoad are declared as int. Since the data values are stored here before being placed in the dictionary structure you pass to the plot datasource, any fractional part of the values gets lost.

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

Sidebar

Related Questions

I have this script which basically toggles a bgColor class on and off so
I have a Sinatra app that, boiled down, looks basically like this: class MyApp
I have this type which is basically a struct { int x,y,z; } that
I have built a LWUIT UI class which contains the Midlet. I am basically
I have a couple of Divs which I style using a class and an
I have a class which extends the Runnable . This class performs some heavy
I have this error that is keeping me from moving forward. I basically have
Basically I have this string for example $str = 'По, своей 12' I need
Basically I have this string $str=word1 word2 word3; I need array( 'word1', 'word2', 'word3'
So basically I have this giant regular expression pattern, and somewhere in the middle

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.