PDA

View Full Version : Pie chart legend problem



dave26540
26 Jan 2010, 2:43 PM
Hello,
I want to make a pie chart with a lot of elements.I want to display the legend on the right side of the pie chart.



store_cheese = new Ext.data.GroupingStore({
proxy: new Ext.data.HttpProxy({
url: 'recupchaine.asp',
method: 'POST',
success:function(transport){
rep = eval("("+transport.responseText+")");
Ext.getCmp("panelcheese").setTitle(rep.title);
}} ),
reader: new Ext.data.JsonReader({
root:'results',
totalProperty:'total',
fields:[
{name:'pays'},
{name:'nombre'}
]
})
});

new Ext.Panel({
width: 800,
height: 800,
id:"panelcheese",
title: '<br/>',
renderTo: 'cheesestat',
items: {
store: store_cheese,
xtype: 'piechart',
dataField: 'nombre',
categoryField: 'pays',
//extra styles get applied to the chart defaults
extraStyle:
{
legend:
{
display: 'right',
padding: 5,
font:
{
family: 'Tahoma',
size: 9
}
}
}
}
});
It's ok, it works but i have a problem with the display of the legend. I have a lot of elements so the legend doesn't display all the items. I would like to display the items on two columns. is it possible ?

thanks ( sorry for my english)

Bruno0226
6 Mar 2010, 1:16 PM
It is not the solution, but it will help you to show a litte more elements.

legend : {
display : 'left',
spacing : 'absolute', //or relative
padding : 0,
font : {
family : 'Tahoma',
size : 9
}
}

brado
26 Apr 2011, 7:50 AM
I have the same problem with the Pie chart legend. When there is a lot of items, legend items are not visible. Is there a way to specify the size of the legend or simply have it scroll?
Thanks!

lkc513
19 Jul 2012, 11:02 PM
here have some solutions, try to get the one you need here..

http://www.sencha.com/forum/showthread.php?131384-ExtJS-4-chart-legend-sizing&p=806638&viewfull=1

sumit_bnglr
2 Dec 2012, 10:25 PM
It might help you

http://www.sencha.com/forum/showthread.php?102416-Pie-Chart-how-to-customize-legend-text&p=917334


Thanks,
Sumit