gasparuff
gasparuff

Reputation: 2295

Core Plot - set zoom level to show only part of graph

I'm having this Plot:

Coreplot 1

Every tick on the X-axis represents a day in the calendar. But as you can see, the date is very hard to read so I would like to set the the zoom level to show only 7 days instead of 11 (like right now). Please see screenshot below:

enter image description here

But it's important to have more data available, so users can scroll to the left and there will still be dates shown.

How would I do that?

Thanks in advance.

Upvotes: 0

Views: 1002

Answers (1)

rakeshNS
rakeshNS

Reputation: 4257

You need to set the xRange and globallXRange properties to get work.

plotSpace.xRange = [CPPlotRange 
                    plotRangeWithLocation:CPDecimalFromFloat(0.0) 
                    length:CPDecimalFromUnsignedInteger(10)];

[plotSpace setGlobalXRange:[CPTPlotRange 
                    plotRangeWithLocation:CPTDecimalFromFloat(0.0) 
                    length:CPDecimalFromUnsignedInteger(50)]];

Pass location and length values correctly.

Upvotes: 5

Related Questions