Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First and last symbol were cut off #352

Open
PhamPhiPhuc opened this issue Oct 24, 2017 · 1 comment
Open

First and last symbol were cut off #352

PhamPhiPhuc opened this issue Oct 24, 2017 · 1 comment
Labels

Comments

@PhamPhiPhuc
Copy link

PhamPhiPhuc commented Oct 24, 2017

For example, I has chart data:

self.chartData = @[@{@"x": @0, @"y": @3},
                   @{@"x": @1, @"y": @3},
                   @{@"x": @2, @"y": @2},
                   @{@"x": @3, @"y": @8},
                   @{@"x": @4, @"y": @6},
                   @{@"x": @5, @"y": @9}];

and set the xRange:

[plotSpace setXRange:[CPTPlotRange plotRangeWithLocation:[NSNumber numberWithInt:0] length:[NSNumber numberWithInt:5]]];

The first and the last plot symbol will be cut off.

There are any way to set padding from axises to have more space to draw symbols. Or any way to prevent plot symbol to be cut off.

I don't want to set xRange to [-1 : 6]

@PhamPhiPhuc PhamPhiPhuc changed the title First and last symbol were cut off if plot reach the range First and last symbol were cut off Oct 25, 2017
@Dirk-
Copy link

Dirk- commented Jan 19, 2020

You can always set the plot range to real (not integer) numbers:

int xMin = 0;
int xMax = 5; 
int dataLength = xMax - xMin;
double padding = dataLength * 0.1; // 10%, for example
[plotSpace setXRange:[CPTPlotRange plotRangeWithLocation:@(xMin - padding) length:@(dataLength + 2*padding)]];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants