scroll goes over numbers when scroll on Yaxes is on the same side as axes

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
s_mazyar
Posts: 9
Joined: Sun Nov 21, 2021 10:14 am

scroll goes over numbers when scroll on Yaxes is on the same side as axes

Post by s_mazyar » Sun Nov 21, 2021 10:33 am

When I have scroll on the left and yaxes on the left scroll bar goes over the numbers

Arction_LasseP
Posts: 141
Joined: Wed Mar 27, 2019 1:05 pm

Re: scroll goes over numbers when scroll on Yaxes is on the same side as axes

Post by Arction_LasseP » Mon Nov 22, 2021 7:38 am

Hello,

This happens because the chart doesn't automatically adjust the margins to fit the Y-axis labels, title and the scrollbar.
To make the scrollbar not to overlap the labels, you need to adjust its Offset property:

scrollBar.Offset = new PointIntXY(20, 0);

This will place the bar on the right side of the Y-axis within the graph area.

If you want to have the scrollbar outside the graph (to the left of the axis), you need to manually adjust the margins as well. For example:

scrollBar.Offset = new PointIntXY(-50, 0);

_chart.ViewXY.AxisLayout.AutoAdjustMargins = false;
_chart.ViewXY.Margins = new System.Windows.Thickness(70, 30, 10, 50);

Hope this helps.
Best regards,
Lasse

Post Reply