Is there a way to set the visible x-axis range in JSChart despite the range of the data set?
I use JSChart to draw a line chart. The x-axis is date. The y-axis is an integer value (from 0 to 100). Let's save x-axis min value is 2000-1-1 and max value is 2010-12-31). Is there way way to configure JSChart to show only the part of data say (2005-1-1 to 2006-1-1)?
I have tried doing
config.data = myData
config.options.scales.x.suggestedMin = start
config.options.scales.x.suggestedMax = end
where start is 2005-1-1
and end is 2006-1-1
. But JSChart still show my data from the beginning, i.e. 2000-1-1.
see this ref:
suggestedMin
only change the data values that are used to scale the axis.
To change the explicit ends of the axis, use min
and max
.