Is it poss开发者_开发百科ible to get min/max values of the x axis (TimeAxis) after the data was loaded into the chart's store?
I managed to do this in the following way:
chart.setXAxis(new Ext.chart.TimeAxis({
minimum: newValue
}));
Hope it will be helpful for somebody.
For numeric axis, on ExtJS 3 works the following code:
assign an Id to the chart (or put it into a variable)
items: { xtype: 'linechart', id: 'MyChart', store: store, ....
When you need to access the axis variables, identify the chart and then its properties:
var chart = Ext.getCmp ('MyChart');
Get/Set new values for the axis minimum / maximum:
chart.yAxis.minimum = newMinimum; chart.yAxis.maximum = newMaximum;
You should be able to get the max/min values of the axis using the public properties. The maximum
& minimum
public property available for TimeAxis are the max and min values used by the axis. If you do not explicitly set the values, they are generated automatically by the library during rendering of the graph (chart).
You should be to access these values from the Axis objects.
精彩评论