views:

100

answers:

1

Hi,

I was wondering if the following scenario is possible in jqPlot.

The chart i need to build has y-axis displaying price data and x-axis displaying time series data. The data will be retrieved on a daily basis but i would like the display along the x-axis to be in quarterly segments so Q1 conatins all daily data from 01/01/2010 to 31/03/2010 and so on.

Is this possible?

Is it also possible to set the x-axis to always display Q1 to Q4 rather than from the first date to the last date in the array that is retrieved from the server even if the whole years data is not present i.e. say in Q1 we only have data starting from 01/01/2010?

+1  A: 

You should take a look at the options tutorial and the options reference.

Simply manipulate the min, max, and numberTicks options to create an x-axis that is better formatted for your purposes. You'll likely also want to set the pad option to zero as well.

As an example, I recently used this to create ticks at 0%, 20%, etc, and to ALWAYS display 0-100% on the y-axis:

'yaxis' : {
  'min' : 0,
  'max' : 100,
  'pad' : 0,
  'numberTicks' : 6
}
David Eads