View Full Version : LineChart - alwaysShowZero

25 Sep 2009, 6:30 AM
I have a problem with LineCharts with Ext 3.0. I have set alwaysShowZero to false for my yAxis as my data is often very similar values (currencies) and so have to have the minimum set to the lowest value. This works fine when I have numbers around 10. But when doing UK Sterling to US Dollars for instance the values are always around 1.5 and the chart displays no data. If I set the minimum and maximum manually it displays (but then it's ignoring the alwaysShowZero flag then in any case). I can't do this however as I wish it to always automatically work out the bounds.

For now I have to remove the alwaysShowZero flag so my chart displays something for these values, but it's almost useless then as the units are then so large you can't see the difference on the chart. Example chart show below.

Does anyone know how to get this to work?


25 Sep 2009, 7:07 AM
How did you configure adjustMaximumByMajorUnit, adjustMinimumByMajorUnit and majorUnit?

28 Sep 2009, 3:23 AM
Condor thanks for the reply,

I didn't have any of these values set although I'd tried using majorUnit before without success. Playing around now and I set majorUnit to 0.1 which looks much better in most cases. But for some currencies I'd really like it to be 1. Is there a way of setting this programmatically before/after load?

I don't see adjustMaximumByMajorUnit or adjustMinimumByMajorUnit anywhere in the docs and can't get them to do anything. But then I can't even say where it says the LineChart has an Axis so I guess I just don't know where I should be looking. *blush*

Getting there though, thanks for the pointer.

28 Sep 2009, 3:37 AM
They are indeed config options of NumericAxis (see YUI docs (http://developer.yahoo.com/yui/docs/YAHOO.widget.NumericAxis.html)).

28 Sep 2009, 5:48 AM
I realise the Ext Charts use YUI, I assumed it was just a subset and any parameters not mention in the Ext 3.0 docs meant they were unsupported. Thus I'd never looked too much into the YUI documentation for charting. I think it would be helpful if the Ext Docs told people to check YUI for more details.

But thanks, I'll go read them.