View Full Version : Negative Axis Charts - ExtJs 4

28 Apr 2014, 11:42 PM
I've a case in which the chart data has negative values to be plotted. ExtJs is plotting the negative values in the chart without giving any config change. But it doesn't look fine { as shown in attachment 1 }.

I've added the config as "minimum : -20" and got the desired chart { as in attachment 2}.

Now the problem is, I've given the minimum config but I dont have any negative values to be plotted then the whole thing gets awkward shifting the axis upwards {as in attachment 3 }

My requirements & queries are :
1. Is there a way that ExtJs would act dynamically and place the negative axis only if data has negative values.
2. How to determine the least minimum of all data points that comes for plotting to give in the "minimum : " configuration.

Please help me out.:s. Thanks and regards,
Satya Dileep Kumar Thotakura.

Gary Schlosberg
30 Apr 2014, 6:07 PM
I took the column example form the docs and put it in this Fiddle:

I removed the 'minimum' config from the axis and the range appropriately spans across zero to include the negative value. Does this work for you? If not, which specific version of ExtJS 4 are you using?