PDA

View Full Version : How-to? Adding PieCharts labels which aren't cut?



prodigy7
2 Oct 2009, 12:46 AM
Hi,

I try to using the piechat. So far no problem in the function but when I define labels which are too width, the most thing is cut. Now, I looked at yui and see, that this is fixed with 2.8.0 but when I set Ext.chart.Chart.CHART_URL with the yui 2.8.0 path, the flash isn't shown.
Somehow I think the interface has changed so that it doesn't work directly with extjs 3.
Now, I found no indicator what's wrong and why the flash isn't shown. My idea was now, writing an simple plugin für piechat which extends the piechart with an div-box which contains the labels including the corresponding colors - but currently I've no idea how I can "hook" me into the existing stuff. I've this sceleton:

Ext.ux.PieChartLabel = Ext.extend(Ext.chart.PieChart, {

/**
* @param Array
*/
labelColors: [ '00B8BF', '8DD5E7', 'EDFF9F', 'FFA928', 'C0FFF6', 'D00050', 'C6C6C6', 'C3EAFB', 'FCFFAD', 'CFFF83', '444444', '4D95DD', 'B8EBFF', '60558F' ],

/**
* constructor
* @param config
*/
constructor: function(config) {
config = config || {};
Ext.apply(this, config);
},

// private
init : function(obj) {
}

});
Ext.reg('piechartlabel', Ext.ux.PieChartLabel);My idea was now, doing similiar like here: http://www.extjs.com/forum/showthread.php?t=81395
The problem is, that the component type is piechart which hasn't an add function so that I can't add an div with obj in the init function ...
Can someone help me, finding the crux in this case? From my point of view I think, adding an label box shouldn't be a problem but i miss the right start point.

14 Oct 2009, 3:33 AM
you can create a composite component that uses a container with a layout that leverages a listview or dataview for the legend and the pie chart can sit to the side.