siva565
siva565

Reputation: 11

Extjs4 pie chart problem

I am facing following problems with the Extjs4 pie chart:

  1. I am unable to change pie chart colors
  2. I want to disable legend (not clickable)

please help me..

thanks

Upvotes: 1

Views: 3753

Answers (1)

Rene Saarsoo
Rene Saarsoo

Reputation: 13907

Changing pie colors is easy using the colorSet config:

series: [{
    type: "pie",
    colorSet: ["#f00", "#0f0", "#00f"],
    ...
}]

Disabling the click-behavior of legend is quite a bit trickier, because it is built in to the LegendItem component and there's no switch to turn it off. You could use the following hack to remove the disturbing listeners from Legend:

Ext.each(chart.legend.items, function(item) {
    item.un("mousedown", item.events.mousedown.listeners[0].fn);
})

But I suggest you file a feature request to Sencha, as that kind of built-in behaviour should be configurable.

Upvotes: 4

Related Questions