PDA

View Full Version : [4.2.1] Chart NumericAxis maximum and minimum are ignored for stacked charts. Why?



Daniil
10 Nov 2013, 9:14 PM
https://fiddle.sencha.com/#fiddle/1g4

Ext version tested:

Ext 4.2.1 GA

Browser versions tested against:

IE9
Chrome

DOCTYPE tested against:

<!DOCTYPE html>

Description:

A NumericAxis's maximum and minimum settings are ignored for stacked charts. As it is stated in the docs (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.chart.axis.Numeric-cfg-maximum), but why? There are also two comments of discontent developers.

Steps to reproduce the problem:

Just run the test case

The result that was expected:

Minimum is 10, maximum is 30 according the settings

The result that occurs instead:

Minimum is 0, maximum is 80

LesJ
11 Nov 2013, 7:18 AM
Interesting, this feature appears to work for the column chart.

You have an additional comma, but I don't think this has any impact.


axes: [{
type: "numeric",
position: "left",
fields: ["y1", "y2"],
maximum: 30, // ignored
minimum: 10, // ignored <--- additional comma
}, {

Daniil
11 Nov 2013, 7:50 AM
Thank you for the follow-up, @LesJ.


Interesting, this feature appears to work for the column chart.

For a stacked column chart?



You have an additional comma, but I don't think this has any impact.


axes: [{
type: "numeric",
position: "left",
fields: ["y1", "y2"],
maximum: 30, // ignored
minimum: 10, // ignored <--- additional comma
}, {


Thank you for that catch. Removed. Yes, it should not affect something. Though, it might cause a JavaScript error in IE (legacy, at least).

LesJ
11 Nov 2013, 7:59 AM
I have a plain column chart and this feature works for me.

I'd also try to debug to see why these configs are not picked up in your case.

Daniil
11 Nov 2013, 8:23 AM
Yes, it is not ignored for a non-stacked chart.

It ignores for stacked charts in a NumericAxis's processView method. There is a respective override at the top in the fiddle.

Gary Schlosberg
11 Nov 2013, 9:04 AM
This has been discussed here:
http://www.sencha.com/forum/showthread.php?274968

I added a comment to that ticket noting your interest in a solution allowing minimum and maximum to be set.

Daniil
11 Nov 2013, 10:02 AM
Thank you, Gary.

Unfortunately, I have no permission to see the thread. Though, I have to live with that:)