Page 1 of 1

how can I show only subscribed channels on grid LightningC?

Posted: Mon Jun 17, 2019 4:26 pm
by HelloWorld
Hi guys,
I need Help!!
How can I show only subscribed channels on grid LightningChart?
For example, If I have 5 channels and I want to make one of the channels invisible!!. So, I would remove the Y-axis for the particular channel from the grid chart and make the grid fit only the 4 channels without the one which is invisible. Also when I want to make that channel visible, I would like to add it again to the grid chart.
I attached pictures may help to understand what I need.

Thanks!

Re: how can I show only subscribed channels on grid Lightni

Posted: Tue Jun 18, 2019 10:54 am
by ArctionKestutis
Hi,

If you want to hide/collapse YAxis/segment, it is better to use Segmented layout. A segment has only one property, Height. It is a relational size versus other segments. It is not defined in screen pixels, as they need to rescale with the chart's size.
The Y axes can be assigned with a segment by setting yAxis.SegmentIndex property. The SegmentIndex is the index in the AxisLayout.Segments collection.

Code: Select all

_chart.ViewXY.AxisLayout.YAxesLayout = YAxesLayout.Segmented;
You can create segments with:

Code: Select all

_chart.ViewXY.AxisLayout.Segments.Add(new YAxisSegment());
_chart.ViewXY.AxisLayout.Segments.Add(new YAxisSegment());
Then assign Y-axes to segments:

Code: Select all

_chart.ViewXY.YAxes[0].SegmentIndex = 0;
_chart.ViewXY.YAxes[1].SegmentIndex = 1;
The height of the segments can be changed via their Height-property. Note that Height means relative Height to other segments. Setting it 0 will basically hide the segment and make the other segments larger.

Code: Select all

_chart.ViewXY.AxisLayout.Segments[3].Height = 0;
If the hidden segment has some series in it, they might still be slightly visible even after hiding the segment. Therefore it might be a good idea to set the Visible -property of these series false in order to hide them as well.

There are several examples in our Demo App, which uses segmented layout: “Y axis layout”, “Segments with Splitters” etc.

All the best.