PDA

View Full Version : StackedBarChart query



jaidengre
25 Oct 2010, 1:31 AM
I am using the below to configure my chart


var stackedBarChart = new Ext.Panel({
width: 600,
height: 400,
autoScroll: true,
title: 'Performance Analysis',
items: {
xtype: 'stackedbarchart',
store: getTimeLineStore(),
yField: 'eventName',
xAxis: new Ext.chart.NumericAxis({
stackingEnabled: true
}),
series: [
{style: { colors: ['#F87217', ' #FF0000' , '#4AA02C']}},
{
xField: 'offset',
displayName: 'Start Offset (Time before actual event star.)'
},{
xField: 'totalTime',
displayName: 'Total Time taken'
}]
}
});

I want to apply custom color to each series item. Like offset should have white color and totalTime should have green color. I tried giving style to series but the colors do not get picked up. the colors get changed if i provide a style element in series element but they are not the once which I define. Please help me to configure custom color for series.

Condor
25 Oct 2010, 1:44 AM
Each series needs it's own "style: {color: '#xyz'}" config option.

Also, 'styles' is only valid for pie charts.

jaidengre
25 Oct 2010, 1:55 AM
Thanks Condor. Found the same information on yahoo chart help as well and it worked. However i would now like to use the visibility: 'hidden' option mentioned in http://developer.yahoo.com/yui/charts/#basicstyles

Does visibility: 'hidden' option work for a a series? i am trying it but the series is still visible. Any help on what I might be missing?

Condor
25 Oct 2010, 2:04 AM
It should work, but how are you setting the visibility style?

jaidengre
25 Oct 2010, 2:07 AM
series: [
{
xField: 'offset',
displayName: 'Start Offset (Time before actual event star.)',
visibility: 'hidden'
},{
xField: 'totalTime',
displayName: 'Total Time taken',
style: {
color: 0x54C571

}
}]

jaidengre
25 Oct 2010, 2:07 AM
Got it.. i think it should go under style.. will try that.. thanks