How to Display a particular time period in my chart?


#1

Hi have 4 segments in my app. Each segment has a particular time frame ie. 1 Month, 3 Month, 6 Month & 1 Year.
When i select it should display data from current date to the selected tab.
For example if i select 1 year it should display data from current data to previous year.
And this data should take up the entire frame and display all 12 months on the frame.

How can this be done.


Removing Data out of my time frame
#2

Hi skr,

You can do this as follows:

  • Provide the whole year’s worth of data in your datasource
  • When creating the chart, set the defaultRange on the xAxis to match the default selected segment
  • In your UISegmentedControl's target method, call the setRange method on the xAxis to set the new range.

I hope that helps.

Alison


#3

Thanks aclarke.
Sorry for the delayed reponse .