Erasing a graph lazarus / 55-TAChart ---------------------------------------------------------------------- greatUnknown · 2012-08-29 02:36 Is there a way of erasing a graph without using FreeAndNil? ---------------------------------------------------------------------- wp · 2012-08-29 07:02 Call Chart.ClearSeries. Note that this removes the series instances from the chart. If you want to keep the series and delete only the series data iterate through Chart.Series and call Clear for each Series. Like this: Code: [Select]for i:=0 to Chart.SeriesCount-1 do   if Chart.Series[i] is TChartSeries then     TChartSeries(Chart.Series[i]).Clear; ---------------------------------------------------------------------- Ask · 2012-08-29 07:22 Or, using for-each: Code: [Select]for ch in Chart.Series do   if ch is TChartSeries then     TChartSeries(ch).Clear; Note that the above only works with the list sources, if you used other sources, they must be cleared by their own means. ---------------------------------------------------------------------- greatUnknown · 2012-08-29 23:22 Thank you for the general knowledge, but it didn't work [as Ask predicted] in my specific case because I was using a TUserDefinedChartSource. I ended up, with TUserDefinedChartSource, saving  ...Source.pointsCount, setting pointsCount := 0, and forcing a redraw using  ...Source.reset.  However, this is a polarGraph, with closeCircle = false, so Draw uses polyline.  Polyline does not like 0 points.  Solution: a descendent Draw with  if (pointsCount >0) then inherited Draw did the trick. Redrawing was simply a matter of resetting  ...Source.pointsCount := savedCount, followed by  ...Source.reset. [EDIT] Forcing a redraw using  ...Source.reset is superfluous.  Just changing pointsCount is sufficient. ---------------------------------------------------------------------- Ask · 2012-08-30 02:13 QuotePolyline does not like 0 pointsFixed in r38430. QuoteJust changing pointsCount is sufficient.Yes, this is a correct method for your case.