Reputation: 5722
I have a graph created with CorePlot. The user can switch between scatter chart:
and bar chart:
As you can see in the bar chart case the graph gets moved on the right till the point the second bar is not visible anymore. This does't happen when more than 5 elements get displayed:
it looks like the automatic positioning places wrongly some padding but I'm not sure how to avoid this problem.
Any idea?
Upvotes: 1
Views: 168
Reputation: 5722
I think I've found a possible solution, extending the plot space X-axis range in order to include all the elements and leaving a small margin on the right:
// X-Axis spacing
plotSpace.xRange = [CPTPlotRange
plotRangeWithLocation:CPTDecimalFromFloat(0.0)
length:CPTDecimalFromFloat([graphData count] - 0.7)];
I will wait to set this as optimal solution, just in case somebody comes with something better.
Upvotes: 1