Prevent resizing of the gap between each CustomTicks

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
hallo888
Posts: 43
Joined: Wed Mar 26, 2014 10:56 am

Prevent resizing of the gap between each CustomTicks

Post by hallo888 » Thu Jul 31, 2014 10:25 am

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!

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Prevent resizing of the gap between each CustomTicks

Post by ArctionPasi » Thu Jul 31, 2014 7:11 pm

Howdy. Could you attach a picture of the problem, it would help a lot in providing correct answers.
LightningChart Support Team, PT

hallo888
Posts: 43
Joined: Wed Mar 26, 2014 10:56 am

Re: Prevent resizing of the gap between each CustomTicks

Post by hallo888 » Fri Aug 01, 2014 1:52 am

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.
Attachments
expected_output.jpg
expected_output.jpg (19.44 KiB) Viewed 11525 times
after_chart_resize.jpg
after_chart_resize.jpg (19.8 KiB) Viewed 11525 times
before_chart_resize.jpg
before_chart_resize.jpg (22.09 KiB) Viewed 11525 times

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Prevent resizing of the gap between each CustomTicks

Post by ArctionPasi » Sun Aug 03, 2014 1:20 pm

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

hallo888
Posts: 43
Joined: Wed Mar 26, 2014 10:56 am

Re: Prevent resizing of the gap between each CustomTicks

Post by hallo888 » Mon Aug 04, 2014 2:26 am

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.

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Prevent resizing of the gap between each CustomTicks

Post by ArctionPasi » Mon Aug 04, 2014 11:56 am

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 :)
LightningChart Support Team, PT

hallo888
Posts: 43
Joined: Wed Mar 26, 2014 10:56 am

Re: Prevent resizing of the gap between each CustomTicks

Post by hallo888 » Tue Aug 05, 2014 3:25 am

Hi

I can't find ViewXY.AxisLayout.AutoAdjustMargins. Is this available only in certain version?
Thanks!

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Prevent resizing of the gap between each CustomTicks

Post by ArctionPasi » Tue Aug 05, 2014 5:44 am

The property is available in all 6.x versions.
LightningChart Support Team, PT

Post Reply