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

  • Home
  • SEARCH
  • 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 6031889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:15:07+00:00 2026-05-23T05:15:07+00:00

How to put dates as axis labels in a scatterplot when using coreplot? I

  • 0

How to put dates as axis labels in a scatterplot when using coreplot?

I found in examples how to change the axislabels in barchart..but when i used this code in scatterplot…

this is not working.

  • 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-23T05:15:07+00:00Added an answer on May 23, 2026 at 5:15 am

    It works You need to follow the same code used in barChart plot example. I have done this in scatter plot. Here is a method how I’m doing It.

    - (void) setRangeForGraph {
    
            //Customize x and y axis
            CPLineStyle *lineStyle = [CPLineStyle lineStyle];
            lineStyle.lineColor = [CPColor colorWithCGColor:((UIColor*)kProtienColor).CGColor];
            lineStyle.lineWidth = 1.0f;
    
            CPTextStyle *whiteText = [CPTextStyle textStyle];
            whiteText.color = [CPColor grayColor];              
    
    
            CPXYAxisSet *axisSet = (CPXYAxisSet *)graph.axisSet;
    
            //Customize x axis
            CPXYAxis *x = axisSet.xAxis;
    
            //x.title = @"Date";
            x.majorIntervalLength = CPDecimalFromInteger(1);
    
            x.axisLineStyle = lineStyle;
            x.minorTickLineStyle = lineStyle;
    
            x.titleOffset = 0;
            x.labelOffset = 5;
            x.titleLocation = CPDecimalFromFloat(0);
    
            x.titleTextStyle=whiteText;
            x.labelTextStyle=whiteText;
            x.orthogonalCoordinateDecimal = CPDecimalFromString(@"0");
            x.titleOffset = 0.0f;
    
    
            // Define some custom labels for the data elements
            x.labelRotation = M_PI/4;
            x.labelingPolicy = CPAxisLabelingPolicyNone;
    
            NSMutableArray *ticks = [[[NSMutableArray alloc] initWithCapacity:[self.weightEntries count]] autorelease];
    
            for(unsigned int counter = 0; counter < [self.weightEntries count];counter++){
                [ticks addObject:[NSNumber numberWithInt:counter]];
            }
    
            NSUInteger labelLocation = 0;
    
            NSArray *xAxisLabels = [self createDateAxisLabels];
    
            NSMutableArray *customLabels = [NSMutableArray arrayWithCapacity:[xAxisLabels count]];
    
            @try {
    
                for (NSNumber *tickLocation in ticks) {
                    CPAxisLabel *newLabel = [[CPAxisLabel alloc] initWithText: [xAxisLabels objectAtIndex:labelLocation++] textStyle:x.labelTextStyle];
                    newLabel.tickLocation = [tickLocation decimalValue];
                    newLabel.offset = 0;//x.labelOffset + x.majorTickLength;
                    newLabel.rotation = M_PI/4;
                    [customLabels addObject:newLabel];
                    [newLabel release];
                }
    
            }
            @catch (NSException * e) {
                NSLog(@"An exception occured while creating date labels for x-axis");
            }
            @finally {
                x.axisLabels =  [NSSet setWithArray:customLabels];  
            }
    
    
            //Customize y axis
    
            CPXYAxis *y = axisSet.yAxis;
    
            //y.title = @"Weight";
            y.majorIntervalLength   = CPDecimalFromFloat([high floatValue]/7);
    
            y.orthogonalCoordinateDecimal = CPDecimalFromString(@"0");
    
            y.titleOffset           = 35.0f;
            y.titleLocation         = CPDecimalFromFloat([high floatValue]/2);
            y.paddingLeft           = 0;
            //y.majorIntervalLength = CPDecimalFromString(@"150");
            y.minorTicksPerInterval = 5;
            y.axisLineStyle         = lineStyle;
            y.titleTextStyle        = whiteText;
            y.minorTickLineStyle    = lineStyle;
            y.labelTextStyle        = whiteText;
            y.orthogonalCoordinateDecimal = CPDecimalFromString(@"0");
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is what i want. but i have put only a specified date. SELECT
I'm trying to put 2 vectors of dates together in one data frame but
I’m using C# and WinForms to try and put just the date from a
Application is asp.net MVC. I want to put a textbox for date using mask.
I'm trying to put the logic together for this and it seems like I
I'm trying to render a calendar with Rails and Haml . The dates used
I need my dates to be in U.S date format. How do I change
I need to calculate the DateDiff (hours) between two dates, but only during business-hours
I'm using a function i found on php.net(i think) to sort an array based
I'm using a PHP form to put values into a table I have. Everything

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.