how can I show only subscribed channels on grid LightningC?

Need help in implementing some specific function to your LightningChart Ultimate powered application? Post a question and get code snippets from other LightningChart Ultimate community members.

Moderator: Arction_LasseP

Posts: 2
Joined: Mon Jun 17, 2019 4:08 pm

how can I show only subscribed channels on grid LightningC?

Post by HelloWorld » Mon Jun 17, 2019 4:26 pm

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.

Ex2 >>need What I
Ex2 >>need What I
Example 2.PNG (87.22 KiB) Viewed 3079 times
Example 1.PNG (80.51 KiB) Viewed 3079 times

Posts: 411
Joined: Mon Mar 14, 2016 9:22 am

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

Post by ArctionKestutis » Tue Jun 18, 2019 10:54 am


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.