Reputation: 2405
I've built a column chart using dojo 1.4.3 ( websphere portal 7 custom dojo build ) and so far i can easily update the chart's series using the updateSeries method.
Now i need to update the axis labels everytime i update the chart's series. I've looked around and found no method to do that. Has anyone found such method or know's a workaround ?
Thanks in advance.
Upvotes: 0
Views: 1033
Reputation: 123
I'm doing this right now as well. There's no set method to update an axis, but you can adjust the options at anytime.
var myAxis = this.chart.getAxis("x");
myAxis.opt.labelFunc = function (value) {
return xAxisLabelArray[value -= 1];
};
this.chart.fullRender();
You have to do a fullRender on the chart after you've changed any of the options in this way.
Upvotes: 1
Reputation: 317
I think, the "right way" in this case is to rebuild the chart with new data. But before doing this you need to destroy an old chart (and a legend as well):
...
chart.destroy();
legend.destroyRecursive(true);
...
Upvotes: 0