Adding and Removing Series in FNC Chart vs. TeeChart

Hello,

I'm trying to migrate from TeeChart to TMS FNC Chart. I was able to convert my TeeChart-enabled projects to FNC Chart with a little bit of effort, but there's one thing that I'm not able to do with FNC Chart which was really easy with TeeChart. I don't know if I'm doing something wrong, or if this is simply not possible with FNC Chart.

Please see my attached example projects. If you compile the TeeChart test, you will see the functionality that I'm looking for. I need to be able to turn on and off the different series in a chart. I can do this easily with TeeChart using a single line of code:

if CheckBox1.Checked then Chart1.Series[0].Active := true else Chart1.Series[0].Active := false;

But when I tried modifying the basic FNC Chart demo to try and accomplish the same thing, I was unsuccessful. I spent several hours looking for the equivalent functionality but couldn't find it. I also read all 48 pages of the FNC Chart developer's guide, but I didn't find anything there that would be helpful to my situation.

The only thing I can think of for an explanation is that TeeChart has properties such as LeftAxis which are connected to the chart itself. And it appears to me that FNC Chart has those same properties connected to the individual series instead of the chart.

I would really appreciate some help, because if there's a simple and obvious solution, I haven't been able to find it.

Chart Test.zip (17.2 KB)

The Y-Axis values are linked to the series, this way you can have multiple Y-Axis, working independently. In the case you have, the Visible property of the series also hides the Y-Axis which is by design, so the code needs to be slightly smarter and turn on one of the Y-Axis of the series that are visible. I've modified the code and attached it for review.

FNCChartTest_Modified.zip (7.7 KB)

Thank you, Pieter!

That's exactly what I was looking for.

Your welcome, thanks for confirming!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.