Hi
I noticed that the gap between each CustomTicks will change in size when the size of the chart is changed. Is there a way to fix the gap size such that it remains unchanged when the size of the chart is changed?
Thanks!
Prevent resizing of the gap between each CustomTicks
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Prevent resizing of the gap between each CustomTicks
Howdy. Could you attach a picture of the problem, it would help a lot in providing correct answers.
LightningChart Support Team, PT
Re: Prevent resizing of the gap between each CustomTicks
Hi
I have uploaded 3 pictures.
before_chart_resize.jpg - This shows how the chart looks like before the height of the panel is being resized.
after_chart_resize.jpg - This shows how the chart looks like after the height of the panel is being resized. Noticed that the gab between each CustomTicks is reduced to fit into the chart. I did not execute the FitView() function.
expected_output.jpg - This is what I wanted. After resizing the height of the panel, the gap between each CustomTicks should still remain the same as the one in before_chart_resize.jpg. The user will then need to use the scrollbar (possibly) to see the points above.
Thanks.
I have uploaded 3 pictures.
before_chart_resize.jpg - This shows how the chart looks like before the height of the panel is being resized.
after_chart_resize.jpg - This shows how the chart looks like after the height of the panel is being resized. Noticed that the gab between each CustomTicks is reduced to fit into the chart. I did not execute the FitView() function.
expected_output.jpg - This is what I wanted. After resizing the height of the panel, the gap between each CustomTicks should still remain the same as the one in before_chart_resize.jpg. The user will then need to use the scrollbar (possibly) to see the points above.
Thanks.
- Attachments
-
- expected_output.jpg (19.44 KiB) Viewed 11528 times
-
- after_chart_resize.jpg (19.8 KiB) Viewed 11528 times
-
- before_chart_resize.jpg (22.09 KiB) Viewed 11528 times
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Prevent resizing of the gap between each CustomTicks
I'm sorry but I don't still understand your question. It seems you are using CustomTicks on top X axis? X axis range or tick intervals don't adjust when adjusting chart height. Y axis range keeps the same, but Y axis tick interval in pixels is adjusted.
LightningChart Support Team, PT
Re: Prevent resizing of the gap between each CustomTicks
Hi
I'm sorry that I'm not clear enough.
I'm using CustomTicks for the Y-axis. Looking at the diagrams, you will notice the Y-axis tick interval in pixels is adjusted when I reduce the height of the chart. I am looking for a way to keep the Y-axis tick interval the same regardless of the height of the chart.
Thanks.
I'm sorry that I'm not clear enough.
I'm using CustomTicks for the Y-axis. Looking at the diagrams, you will notice the Y-axis tick interval in pixels is adjusted when I reduce the height of the chart. I am looking for a way to keep the Y-axis tick interval the same regardless of the height of the chart.
Thanks.
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Prevent resizing of the gap between each CustomTicks
That needs some code calculating new Y axis range based on the graph height in pixels. Please take a look at ECG millimeter grid example, and see if you can utilize that. It uses a little bit overkill approach because it also takes actual screen size in millimeters into account.
Disable automatic graph margins by setting ViewXY.AxisLayout.AutoAdjustMargins = false.
Set the margins manually by settting ViewXY.Margins property.
Set chart.SizeChanged event handler. In the handler, investigate the chart actual height :
Graph height in pixels = chart.ActualHeight - ViewXY.Margins.Top - ViewXY.Margins.Bottom
or use chart.ViewXY.GetMarginsRect().Height
You need determining how many pixels per value you want. Say 10 px / 1. If your graph height is 100 px, then you can show 0...10 range.
yAxis.SetRange(lowValue, highValue).
Something like that
Disable automatic graph margins by setting ViewXY.AxisLayout.AutoAdjustMargins = false.
Set the margins manually by settting ViewXY.Margins property.
Set chart.SizeChanged event handler. In the handler, investigate the chart actual height :
Graph height in pixels = chart.ActualHeight - ViewXY.Margins.Top - ViewXY.Margins.Bottom
or use chart.ViewXY.GetMarginsRect().Height
You need determining how many pixels per value you want. Say 10 px / 1. If your graph height is 100 px, then you can show 0...10 range.
yAxis.SetRange(lowValue, highValue).
Something like that
LightningChart Support Team, PT
Re: Prevent resizing of the gap between each CustomTicks
Hi
I can't find ViewXY.AxisLayout.AutoAdjustMargins. Is this available only in certain version?
Thanks!
I can't find ViewXY.AxisLayout.AutoAdjustMargins. Is this available only in certain version?
Thanks!
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Prevent resizing of the gap between each CustomTicks
The property is available in all 6.x versions.
LightningChart Support Team, PT