PDA

View Full Version : ExtJS Radar Chart Null Values



ronenil
15 Apr 2013, 1:26 AM
Hi all,


I've been trying to create a radar chart from 0-5 range.


i recently encountered a bug\issue, when one of the axis holds null value Sencha displays is as 0 which is worse for my logic.


Someone is familiar with any workaround that will remove the null value marker from the radar chart ?


I have been trying to find few workaround such as static radar axis that may be my solution.




just for clarification i am usting ExtJS 4.0.8 and already tried using JsonStore and data Store models.I tried to pass both 'undefined' and 'null' values but still they are displayed as 0.


here is my code snippet :






Ext.define('RadarValue', {
extend: 'Ext.data.Model',
fields: [{name:'Category', type: 'string'},{name:'Value', type:'int'}]
});

var store2= Ext.create('Ext.data.Store', {
model: 'RadarValue',

});

var _point;
for (var i=0; i<MyData.length; i++)
{
_point = Ext.create("RadarValue",{
Category: MyData[i].Category,
Value: MyData[i].Value
});

store2.add(_point);

}

var chart = Ext.create('Ext.chart.Chart',
{
renderTo: 'radardiv',
width: 600,
height: 500,
style: 'background:#fff',
theme: 'Category2',
layout: 'fit',
store: store2,
insetPadding: 50,
highlight:true,

axes: [{
maximum: 5,
minimum:0,
steps:6,
type: 'Radial',
position: 'radial',
label: {
font: "11px Arial",
display : true
}
}],

series: [{

type: 'radar',
xField: 'Category',
yField: 'Value',
showMarkers: true,
markerConfig:
{
radius: 5,
size: 5
},

style: {
'stroke-width': 2,
stroke:'#333333',
fill: '#70dddd',
opacity:0.4
}
}]
});




here is my function that parses the data




var radarData= new Array();
for ( var j=1; j<TableData.length;j++)
{
var Point = {};
if (!isNaN(parseFloat(TableData[j][2])))
{
p5Point.Category = TableData[j][1];
p5Point.Value = TableData[j][2];
}
else
{
Point.Category = TableData[j][1];
Point.Value =null;
}
radarData.push(Point);
}


return radarData;
}

slemmon
16 Apr 2013, 2:38 PM
I'm afraid there's not a way to omit a data point for the radar series. The only series I believe that will support that is line which you can pass false to in order to omit the data point.