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
Segment heights and minimum fixed value
Moderator: Queue Moderators
-
- Posts: 557
- Joined: Mon Mar 14, 2016 9:22 am
Re: Segment heights and minimum fixed value
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)
Example of such usage could be found in our Demo (Interactive Examples App). Here is the screenshot to one of them (ExampleYAxesLayouts)
-
- Posts: 12
- Joined: Mon Nov 22, 2021 8:12 am
Re: Segment heights and minimum fixed value
And what exactly is chart.ViewXY.GetGraphSegmentInfo().GraphHeight in a segmented axis layout? What does the value represent and what unit is it in?
-
- Posts: 141
- Joined: Wed Mar 27, 2019 1:05 pm
Re: Segment heights and minimum fixed value
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:
The segment height is also in pixels.
Best regards,
Lasse
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];
Best regards,
Lasse