如何在Sencha ExtJS图表中反转轴? [英] How to reverse an Axis in Sencha ExtJS Charts?
问题描述
我有一个折线图,其中x轴为数字,y轴为数字。我希望将y轴反转,以便较高的值在轴的底部,较低的值在顶部。我看了看API Docu,没有找到使轴反转的配置。有任何线索吗?
I have a line chart with x Axis being numeric and y axis being numeric as well. I want the y axis to be reversed so that higher values are at the bottom of the axis and lower values at the top. I looked at the API Docu and didnt find a config to reverse the axis or so. Any clues?
推荐答案
在ExtJS 3中,有一个反向配置选项可以解决这个问题。使用ExtJS 4,您必须使用变通方法。
In ExtJS 3 there was a reverse config option to get this going. With ExtJS 4 you have to use workarounds.
要还原x轴值,可以使用连接到图表的商店的sorters属性。
For reverting the x axis values you could use the sorters property of the store connected to the chart.
但是要还原y轴,您必须转换值。以下是有关如何实现此目的的示例: http://www.sencha.com/forum/showthread.php?132148-What-has-happen-to-quot-reverse- quot-config-on-chart-axes& p = 949699& viewfull = 1#post949699
But for reverting the y axis you have to convert your values. Here's a sample on how to achieve this: http://www.sencha.com/forum/showthread.php?132148-What-has-happen-to-quot-reverse-quot-config-on-chart-axes&p=949699&viewfull=1#post949699
这篇关于如何在Sencha ExtJS图表中反转轴?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!