开发者

ExtJs Chart TimeAxis minimum/maximum value

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:

  1. assign an Id to the chart (or put it into a variable)

    items: {
        xtype: 'linechart',
        id: 'MyChart',
        store: store,
        ....
    
  2. When you need to access the axis variables, identify the chart and then its properties:

    var chart = Ext.getCmp ('MyChart');
    
  3. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜