Search code examples
javateechart

Clear existing chart and add new data


I have created a chart and would like to completely clear it out and re-use it with new data.

How would I go about completely clearing the chart of all series/draw lines etc?


Solution

  • You can use the code below. There's no TChart.clear() method in the Java version as in other TeeChart versions. I have added this (TJ71016243) to the wish-list to be implemented for next releases.

    tChart1.removeAllSeries();
    tChart1.getTools().removeAll(tChart1.getTools());