PDA

View Full Version : [CLOSED]Piechart doesn't response backgroundColor



drampulla
2 Oct 2009, 12:05 PM
It appears that when I modify the piechart example to include backgroundColor:'#37250d' the background remains white. Is this a bug in ext-3.0.0?



new Ext.Panel({
width: 400,
height: 400,
title: 'Pie Chart with Legend - Favorite Season',
renderTo: 'container',
items: {
store: store,
xtype: 'piechart',
dataField: 'total',
categoryField: 'season',
backgroundColor: '#37250d',
//extra styles get applied to the chart defaults
extraStyle:
{
legend:
{
display: 'bottom',
padding: 5,
font:
{
family: 'Tahoma',
size: 13
}
}
}
}
});

evant
5 Oct 2009, 6:56 PM
The backgroundColor option should be hidden for charts. The option just sets the params of the SWF, but the styling info of the chart overrides it.

Instead you should use:



extraStyle: {
background: {
color: '#37250d'
},
legend: {
display: 'bottom',
padding: 5,
font: {
family: 'Tahoma',
size: 13
}
}
}


I'll update the docs to hide the backgroundColor option.

NoahK17
19 May 2010, 2:34 PM
Docs still show backgroundColor as an option, and it confused me as well. Cheers.