Hi guys,
My pie chart is very simple:
But I would like that the empty record does not appear in the legend like it does actually:
Capture.PNG
Not display empty record in chart
First: Here is the fiddle that explains clearly my problem : http://ift.tt/166tPpR
To sum up, I have a very simple chart bound to a store. The store has few "empty" records and is like this:
Code:
var storeA = Ext.create('Ext.data.Store', {
fields: ['name', 'value', 'length'],
data: [
{"name": "A-0", "value": 18.34, "length": 30},
{"name": "A-1", "value": 2.67, "length": 35},
{"name": "", "value": 0, "length": 0} // this is what I call an empty record
]
});
My pie chart is very simple:
Code:
var donut = Ext.create('Ext.chart.PolarChart', {
title: 'Test',
animation: true,
width: 300,
height: 300,
renderTo: Ext.getBody(),
store: storeA,
legend: {
docked: 'bottom'
},
series: [{
type: 'pie',
angleField: 'value',
lengthField: 'length',
colors: ["#9aff4f", "#35b4e3", "#ffb400"],
donut: 20,
label: {
field: 'name',
display: 'inside'
},
highlight: true
}]
});
But I would like that the empty record does not appear in the legend like it does actually:
Capture.PNG
I would like to add that I don't want to clean the store before giving it to the chart. I need to use this exact same store.
Not display empty record in chart
Aucun commentaire:
Enregistrer un commentaire