PDA

View Full Version : quick question about column chart



ahsec
24 May 2012, 7:49 AM
Hey
How do I hold more than 1 column per data...

like the example of high charts here http://www.highcharts.com/demo/column-basic

(http://www.highcharts.com/demo/column-basic) I know how to hold more than 1 column....but what if each category needs more than 1 column..??

I tried using more than 1 series but each one overrode the other ...

Thanks :-)

scottmartin
24 May 2012, 3:04 PM
We have grouped bars:
http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/charts/GroupedBar.html

But I do not believe it is working for columns unless I missed it.

Regards,
Scott.

ahsec
3 Jun 2012, 2:01 AM
Do you on the fly how I can configure the colors of each bar??

I tried adding

var chart = Ext.create('Ext.chart.Chart', {
id: 'chartCmp',
xtype: 'chart',
width:400,
height:400,
style: 'background:#fff',
animate: true,
shadow: true,
store: Ext.getStore('d_barStore'),
legend: {
position: 'right'
},
axes: [{
type: 'Numeric',
position: 'bottom',
fields: ['value', 'value2','value3', 'value3'],
minimum: 0,
label: {
renderer: Ext.util.Format.numberRenderer('0,0')
},
grid: true,
title: 'Alerts'
}, {
type: 'Category',
position: 'left',
fields: ['group'],
title: 'Rule Group'
}],
series: [{
type: 'bar',
axis: 'bottom',
colorSet:['#ad3333' ,'#e6e30e','#81a000'],
xField: 'group',
/*highlight: {
segment: {
margin: 20
}
},*/
yField: ['value', 'value2','value3']//, 'data3']
}]
});


but it didn't work....

thanks

scottmartin
3 Jun 2012, 7:45 AM
Have a look at the following:



var colors = ['rgb(47, 162, 223)',
'rgb(60, 133, 46)',
'rgb(234, 102, 17)',
'rgb(154, 176, 213)',
'rgb(40, 40, 40)'];

Ext.chart.theme.Browser = Ext.extend(Ext.chart.theme.Base, {
constructor: function(config) {
Ext.chart.theme.Base.prototype.constructor.call(this, Ext.apply({
colors: colors
}, config));
}
});


Then in your in chart:



theme: 'Browser',


Scott.