PDA

View Full Version : [CLOSED] Ext Chart Axis: displaying small float numbers



BnoL
6 May 2013, 3:15 AM
Hi all,

I'm working on "column chart" and having problem with displaying small float number data:

- The data is float and always smaller than 1 (usually 0.0x or 0.00x)

Example store data:


"data": [
{
"date": "29/04/2013",
"data": 0.0295
},
{
"date": "30/04/2013",
"data": 0.0113
},
{
"date": "01/05/2013",
"data": 0.0373
},
{
"date": "02/05/2013",
"data": 0.0293
},
{
"date": "03/05/2013",
"data": 0.0308
},
{
"data": "04/05/2013",
"ctr": 0.0285
},
{
"date": "05/05/2013",
"data": 0.0316
},
{
"date": "06/05/2013",
"data": 0.0218
}
]


And the result is: 43562

As you see the data is always at the bottom of the chart so that we just can't see the changes of each day. :(

Any suggestion?

Thanks

*EDIT BY SLEMMON
Issue observed in 4.1.1, 4.1.3, 4.2, and 4.2.1.883 with the below inline test case (manually setting the minimum to 0 and maximum to .014 shows the desired rendered effect)



var chartDataStore = Ext.create("Ext.data.Store", {
storeId: "chartData",
fields: ['data', 'date'],
data: [{
data: 0.0031,
date: '2013-01-02'
}, {
data: 0.0022,
date: '2013-01-03'
}, {
data: 0.0015,
date: '2013-01-04'
}, {
data: 0.0054,
date: '2013-01-05'
}, {
data: 0.0032,
date: '2013-01-06'
}, {
data: 0.0133,
date: '2013-01-07'
},
]


});


var win = Ext.create("Ext.chart.Chart", {
width: 600,
height: 400,
renderTo: document.body,
layout: "fit",
animate: true,
store: chartDataStore,
axes: [{
type: "Numeric",
position: "left",
fields: ["data"],
title: "Value"
}, {
type: "Category",
position: "bottom",
fields: ["date"],
title: "Date"
}
],
series: [{
type: "line",
axis: "left",
xField: "date",
yField: "data"
}
]
});

BnoL
6 May 2013, 9:31 AM
anyone? :(

slemmon
7 May 2013, 3:14 PM
Are you setting a maximum on your left-numeric axis by chance?

BnoL
8 May 2013, 8:04 PM
Are you setting a maximum on your left-numeric axis by chance?

No, I'm not. But even when I set the property "maximum" to 1, nothing changes.

The configuration for the left axis is just simple like this:


{
title: 'Data',
type: 'Numeric',
position: 'left',
fields: ['data']
}

slemmon
9 May 2013, 1:22 PM
Any chance you can post a code snippet showing your chart/axis/series that uses your data snippet?

BnoL
9 May 2013, 7:32 PM
Any chance you can post a code snippet showing your chart/axis/series that uses your data snippet?

Here is a simple example I made with jsfiddle http://jsfiddle.net/JPEEv/75/
which represents my problem.

You can help me by fixing the code and give your URL :)

Thanks in advance!

BnoL
21 May 2013, 1:31 AM
Up

slemmon
21 May 2013, 3:03 PM
I'm moving this over to the bugs forum to have the devs take a look. In the meantime can you set your minimum and maximum on the axis manually by chance?


minimum: 0,
maximum: 0. 14

slemmon
21 May 2013, 3:05 PM
Thanks for the report! I have opened a bug in our bug tracker.

andyjs
1 Aug 2017, 2:03 PM
Thanks for the report! I have opened a bug in our bug tracker.

I realize it's an old issue but we are still using ExtJS 4 and I just ran into the same problem. Was this ever fixed? If yes, which version?

Thanks,
Andy