PDA

View Full Version : How To Set A Color To The Lines Present In Line Chart?



granjith
20 Jan 2012, 5:36 AM
Hi,

May i know how to set the color for a line in "line chart"? If possible please give me a code snippet for this.

Using below code i was able to change the colors in Bar/Column charts and this theme doesn't work for "line chart".

Ext.chart.theme.Rainbow = [
{
"selector": "chart",
"style": {
"colors": userDefinedColors
},
"specificity": [
0,
0,
2
]
}
];




Thanks
Ranjith.G

ayee879
30 Jan 2012, 1:25 PM
For a line chart you probably have to drill down into the series and apply the colors there. Check the docs for more info http://docs.sencha.com/touch-charts/1-0/#!/guide/touch_charts_styling

Naga
2 Feb 2012, 1:46 AM
you can simply specify this in your series config

{
type: 'line',
yField: 'data2',
style: {
color: 'red',
alpha:5,
fillColor: 0xCCCCCC,
fillAlpha:10,
},
showMarkers: true,
fill : true,
markerConfig: {
type: 'cross',
radius: 5,
'fill': 'red'
},

},