-
26 Apr 2011 2:41 PM #1
[CLOSED-EXTJSIV-1765][4.0.0] Barchart with numeric axis still renders wrong
[CLOSED-EXTJSIV-1765][4.0.0] Barchart with numeric axis still renders wrong
see yourself:
PHP Code:Ext.onReady(function() {
var myData =
[
['Users_1','4'],
['Users_2','1'],
['Users_3','3']
];
var store = new Ext.data.ArrayStore({
fields: [
{name: 'title'},
{name: 'value'}
],
data: myData
});
var panel_usr = Ext.create('widget.panel',
{
width: 580,
height: 300,
renderTo: Ext.getBody(),
title: 'Users',
layout: 'fit',
items:
{
id: 'chartCmp',
xtype: 'chart',
animate: true,
shadow: true,
store: store,
axes: [
{
type: 'Numeric',
position: 'left',
fields: ['value'],
maximum: 10,
minimum: 0,
majorTickSteps: 2,
minorTickSteps: 1,
title: 'Numeric',
grid: true,
label: {
renderer: Ext.util.Format.numberRenderer('0')
}
},
{
type: 'Category',
position: 'bottom',
fields: ['title']
}
],
series:
[
{
type: 'column',
axis: 'left',
label:
{
display: 'insideEnd',
orientation: 'vertical',
'text-anchor': 'middle',
field: 'value'
},
xField: 'title',
yField: 'value'
}
]
}
});
});
vg Steffen
--------------------------------------
Release Manager of TYPO3 4.5
energlobe.de - german online magazine
-
26 Apr 2011 3:13 PM #2
The point is the label renderer. Using Ext.util.Format.numberRenderer('0') you get 3 instead of 3.33, so the complete chart doesn't match with the label.
This is a dilemma, and i only see a chance in using a snap-configuration which corresponds with label renderer.
But with this setting used in the example:
I would expect steps of 2 and minor on 1:Code:maximum: 10, minimum: 0, majorTickSteps: 2, inorTickSteps: 1,
0,2,4,6,8,10
i see/get
0,3.33,6.66,10vg Steffen
--------------------------------------
Release Manager of TYPO3 4.5
energlobe.de - german online magazine
-
3 May 2011 2:20 PM #3
Hi, thanks for your report.
I don't see this as a bug, as you noticed the renderer is flooring the value. If you add a decimal to the current axis values you'll see everything displaying correctly.
I defined majorTickSteps to be the number of major ticks between the minimum and maximum markers in the axis. This is analogous to defining the minorTickSteps as the number of ticks between two majorTicks.
Either way this is just a convention for the configuration.
Thanks again!
-
7 May 2011 12:51 PM #4
Hi,
then the naming is wrong. Steps is clearly the devision, so going from 0 to 10 in steps of 2 gives 0,2,4,6,8,10
Now it is the number of in-between lines, something different, minimum and maximum are also ticks but excluded. Hard to understand and hard to communicate imho.vg Steffen
--------------------------------------
Release Manager of TYPO3 4.5
energlobe.de - german online magazine
-
9 May 2011 1:27 PM #5
I discussed it with Ed at the SourceDevCon, and both ways to define the axis make sense.
majorTickSteps and minorTicksteps, from the naming is what we had before with majorUnit and minorUnit, and it makes totally sense for configuration if you know minimum and maximum, so you can exactly define the way the axis is devided, like:
minimum: 0, maximum: 0, majorTickSteps: 2, minorTicksteps: 1, which would result in axis with
0, (1), 2, (3), 4, (5), 6, (7), 8, (9), 10
The way it behave now should be renamed to a more meaningful naming, like
majorNumberOfTicks and minorNumberOfTicks (just a naming suggestion). This would be the preferred way if you don't know the maximum value and you want a fixed devision on axis.
for example:
majorNumberOfTicks:3, minorNumberOfTicks: 1
which would result with a min value of 0 and max of 800 in
0, (100), 200, (300), 400, (500), 600, (700), 800
or with min of -4 and max of +4 in
-4, (-3), -2, (-1), 0, (1) 2, (3), 4
You see what i mean?vg Steffen
--------------------------------------
Release Manager of TYPO3 4.5
energlobe.de - german online magazine
-
6 Dec 2011 12:16 AM #6
Hi guys,
I got the problem, that I don't know the maximum number at the axis. How can I config my chart, to only use the integer values, like steffen described?
"minimum: 0, maximum: 0, majorTickSteps: 2, minorTicksteps: 1, which would result in axis with 0, (1), 2, (3), 4, (5), 6, (7), 8, (9), 10"
Does not work for me - the chart is empty because of maximum is set to 0.
Any hints?
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[FIXED EXTJSIV-1220] [B3] numeric axis doesn't work as expected
By steffenk in forum Ext:BugsReplies: 3Last Post: 18 Apr 2011, 7:20 AM -
[FIXED-EXTJSIV-799]New issue with Numeric/Time axis
By James Goddard in forum Ext:BugsReplies: 1Last Post: 8 Apr 2011, 1:52 PM -
[CLOSED-EXTJSIV-595] Numeric Axis - always 10 steps
By bbraun in forum Ext:BugsReplies: 1Last Post: 4 Apr 2011, 1:17 PM -
[CLOSED EXTJSIV-146] Several issues with numeric axis
By James Goddard in forum Ext:BugsReplies: 6Last Post: 24 Mar 2011, 7:49 PM -
[OPEN-EXTJSIV-205] Numeric axis issues
By vdan in forum Ext:BugsReplies: 1Last Post: 20 Mar 2011, 11:21 PM


Reply With Quote