Chart - changing initial value on the go

I have a gantt chart where I am displaying data in week (period=“WW”). This initial value is in XML descriptor. Is it possible to give user option to change this to Day or Month at run time?

Hi,

If you want to change a parameter of a chart after it has been already painted you can use repaint() method and chart configuration API:


@Inject
private Chart chart;
...

// cast configuration to type of your chart
SerialChart serialChart = (SerialChart) chart.getConfiguration();
serialChart.getCategoryAxis().setPosition(Position.BOTTOM);

chart.repaint();

This way you can change all the parameters of the chart and repaint it by any user action: click / input / timer / etc.

Thank you so much. It worked like a charm.