PDA

View Full Version : [4.0.0] Charts: themes & legends



Yousef
29 Apr 2011, 2:19 AM
The default theme for chart series uses different colors for markers and lines. As the matter of fact, it seems like there are only 3 types of markers defined. This is confusing when you have a lot of series and especially because the lines themselves do have different colors. In the screenshot you can see what I mean (one would expect the legend item + markers for series 'left4' to be orange just as the line.

Also, the chart seems to break when I try to use any theme other than "Base". Also, I think theming lacks documentation (unless I have missed something).

25841


Sample code:


{
xtype: 'chart',
region: 'center',
animate: false,
shadow: true,
legend: {
position: 'right'
},
store: {
fields: ['name', 'left', 'left2', 'left3', 'left4', 'left5'],
data: [{
name: 0,
left: 0,
left2: 2,
left3: 3,
left4: 4,
left5: 5
}, {
name: 1,
left: 0,
left2: 2,
left3: 3,
left4: 4,
left5: 5
}, {
name: 2,
left: 0,
left2: 2,
left3: 3,
left4: 4,
left5: 5
}, {
name: 3,
left: 0,
left2: 2,
left3: 3,
left4: 4,
left5: 5
}]
},
axes: [{
type: 'Numeric',
position: 'left',
fields: ['left', 'left2', 'left3', 'left4', 'left5'],
title: 'Left'
}, {
type: 'Category',
position: 'bottom',
fields: ['name'],
title: 'Bottom'
}],
series: [{
type: 'line',
xField: 'name',
yField: 'left'
}, {
type: 'line',
xField: 'name',
yField: 'left2'
}, {
type: 'line',
xField: 'name',
yField: 'left3'
}, {
type: 'line',
xField: 'name',
yField: 'left4'
}, {
type: 'line',
xField: 'name',
yField: 'left5'
}]
}