PDA

View Full Version : Pie Chart Legend is only showing chart title



brazen
16 Jul 2012, 12:32 PM
The pie chart legend is showing the same text for every category, specifically whatever text I put in the chart title. How can I get the legend to correctly show the category name? Also, you'll notice the labels are not centered, but I don't really care for my purposes. I don't want the labels; I just added them to demonstrate the problem.

37204



series: [
{
type: 'pie',
label: {
field: 'category',
display: 'rotate',
contrast: true,
font: '12px Arial'
},
showInLegend: true,
title: 'Blood Glucose Summary',
angleField: 'percent',
colorSet: [
'#FF840F',
'#FFAE61',
'#65A227',
'#E27771',
'#EB2B1F'
]
}
],
legend: {
boxStrokeWidth: 0,
position: 'right'
}


it appears this may be related to recent changes to ExtJS. This seems to be a recurring issue with ExtJS 4.1 For one, even your demos aren't using the current syntax (for example, on the pie chart demo you are still using the 'field' attribute which apparently no longer exists; it's now 'angleField'). Second, all the great examples littered on this site, SO and the rest of the web no longer work (e.g. to assign custom colors to a pie chart you now use 'colorSet' instead of 'styles'). It's been a frustrating experience trying to prototype our application with documentation/samples that are no longer applicable.

scottmartin
17 Jul 2012, 2:07 PM
Please send a working example so we can review, as I do not see this behavior.

As for the field .. per the API:


field : String
Alias for angleField.

Scott.

EAHC-IT
20 Sep 2012, 3:24 AM
Hello,

I have the same behaviour...
If I set the title property of the serie (Ext.chart.series.Pie), the legend use that value to display for each.
If not set, the legend show the "field" property of the label object (Ext.chart.series.Series)

Regards
ps: extjs 4.1.1