Page 1 of 1

How to clear axis in chart.

Posted: Tue Feb 11, 2014 12:50 pm
by 13049533
Hi all,

I have small problem with clearing chart.

I am drawing multiple custom vertical axis on left side programatically. I will draw multiple axis based on sensor connection to hardware.

For example: At first time i have connected 8 sensors and i am creating 8 vertical left axis programatically. i will start and it will updating chart perfectly. then i will remove one sensor connection and i will start once again then it has to clear all previous series and axis's in the chart then draw only 7 axis and plot according series.
I tried to clear chart like this

Code: Select all

tchart1.Refresh();
tchart1.Series.Clear();
tchart1.Series.RemoveAllSeries();
But using above code i am able to clear chart and its series but i am not able to clear axis which were drawn programatically are still presenting.

Please help me how to clear chart with including axis. everything working perfect but i want know how to clear those multiple axis.

Thanks.
biji

Re: How to clear axis in chart.

Posted: Thu Feb 13, 2014 2:02 pm
by narcis
Hi biji,

What about clearing the complete chart with TChart.Clear() or do you need to keep some chart settings? If that's the case you can use TChart.Axes.Custom.Clear(). For example:

Code: Select all

      tChart1.Clear();
or

Code: Select all

      tChart1.Axes.Custom.Clear();

Re: How to clear axis in chart.

Posted: Fri Feb 14, 2014 9:03 am
by 13049533
Hi,

Thanks for your advice , its working.

Regards,
biji.