Page 1 of 1

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

Posted: Sun Nov 21, 2021 10:33 am
by s_mazyar
When I have scroll on the left and yaxes on the left scroll bar goes over the numbers

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

Posted: Mon Nov 22, 2021 7:38 am
by Arction_LasseP
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