Page 1 of 1

Segment heights and minimum fixed value

Posted: Thu Jan 13, 2022 9:36 am
by Niels Decker
Hi, I have the following problem with segment heights:

I have a layout of three segments (A, B, C) with their heights being 0.05, 1, 1. All of the heights are of course relative values, not fixed ones. What I want is to assign a fixed minimum value (preferably in pixels) to segment A. I assume that I have to calculate that (relative) size from the ratio of the full height of the chart and the fixed minimum value somehow, but I am unsure how to do this. Is chart.ViewXY.GetGraphSegmentInfo().GraphHeight the full height of the chart in pixels? Any help is appreciated!

Best regards
Niels

Re: Segment heights and minimum fixed value

Posted: Thu Jan 13, 2022 12:08 pm
by ArctionKestutis
You can use relative size (for each vertical/YAxes segment) by using Segmented YAxesLayout.
Example of such usage could be found in our Demo (Interactive Examples App). Here is the screenshot to one of them (ExampleYAxesLayouts)
ExampleYAxesLayouts
ExampleYAxesLayouts
ExampleYAxesLayouts.png (423.75 KiB) Viewed 4700 times

Re: Segment heights and minimum fixed value

Posted: Fri Jan 14, 2022 7:45 am
by Niels Decker
And what exactly is chart.ViewXY.GetGraphSegmentInfo().GraphHeight in a segmented axis layout? What does the value represent and what unit is it in?

Re: Segment heights and minimum fixed value

Posted: Fri Jan 14, 2022 9:00 am
by Arction_LasseP
Hello Niels,

GetGraphSegmentInfo().GraphHeight returns the height of the whole graph area where the data is drawn (the area limited by margins/axes). The value is in pixels.

If you need to get the height of an individual segment, that can be done also via GetGraphSegmentInfo(). For example:

Code: Select all

var gsi = _chart.ViewXY.GetGraphSegmentInfo();
double segmentHeigth = gsi.SegmentBottoms[0] - gsi.SegmentTops[0];
The segment height is also in pixels.

Best regards,
Lasse