PDA

View Full Version : Extjs4-Hiecharts piechart



srikanthreddy karnati
27 Aug 2014, 1:20 AM
I am not getting piechart after running this code.There is some problem with my store I guess.Could someone help me in getting a piechart with extjs4 and highcharts.
My code:
var piechart;
Ext.onReady(function(){
var store=Ext.create('Ext.data.Store',{
fields:['Risk','value'],
data:[['Low Risk',373],
['Medium Risk',55],
['High Risk', 8]]
});
piechart=new Highcharts.Chart({
store:store,
dataField: 'value',
chart: {
plotBackgroundColor: null,
plotShadow: false,
renderTo:'container'
},
title: {
text: 'Portfolio Comparison Report'
},
plotOptions: {
pie: {
allowPointSelect: true,
showInLegend: true,
point: {
events: {
click: function(event) {
var options = this.options;
alert('Hi!!!This is ' + options.name );
}
}
}

}
},
series: [{
type: 'pie',
//dataIndex:'value'
label: {
field: 'Risk',
display: 'outside'
}
}],
legend:{
layout:'vertical',
align:'right'
}
});


Thanks in advance!!!!
});

Gary Schlosberg
27 Aug 2014, 10:24 AM
There's an example on this docs page of a functioning ExtJS chart.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.chart.series.Pie

I've never used highcharts before, but you might try formatting your code to better allow others to quickly see what is going on. What are you looking to gain by adding highcharts to the mix?

srikanthreddy karnati
28 Aug 2014, 12:56 AM
Actually I'm not looking for Extjs charts But for Extjs with highcharts.Please help me!!!

Gary Schlosberg
28 Aug 2014, 8:11 AM
Perhaps this thread will help:
http://www.sencha.com/forum/showthread.php?273344