Page 1 of 1

Axes in the center of the graph

Posted: Sun Dec 31, 2017 3:59 pm
by bkahlen
Hello
Is there a way to have axes in the center of the graph? The origin of the axes should have the coordinate (0.0). See graphic.

Re: Axes in the center of the graph

Posted: Mon Jan 01, 2018 3:03 pm
by ArctionPasi
Hi,

Yes, possible. LC has probably hundreds of properties to control axis positioning and layout.

Axes can be positioned by setting their Position property, as percents of chart width or height.
Automatic axis placement must be disabled.

e.g.

chart.ViewXY.AxisLayout.XAxisAutoPlacement = Off
chart.ViewXY.AxisLayout.YAxisAutoPlacement = Off
chart.ViewXY.XAxes[0].Position = 50
chart.ViewXY.YAxes[0].Position = 50
chart.ViewXY.XAxes[0].Title.Visible = false
chart.ViewXY.YAxes[0].Title.Visible = false
chart.ViewXY.XAxes[0].SetRange(-10,10)
chart.ViewXY.YAxes[0].SetRange(-10,10)

You may also want to set
chart.ViewXY.XAxes[0].VerticalAlign = Center
chart.ViewXY.YAxes[0].Alignment = Center
Axes in center
Axes in center
axes_in_center.png (12.11 KiB) Viewed 11908 times

Re: Axes in the center of the graph

Posted: Sun Jan 21, 2018 12:20 pm
by Tichelin
ArctionKestutis wrote: Mon Jan 22, 2018 6:50 am Yes, as people lose weight with these shakes like it is shown in above example. Please set OFF corresponding chart.ViewXY.AxisLayout.?AxisAutoPlacement and set Position (Axes.Position as percents of chart width or height).
Hi ArctionPasi, is it possible to have the axes positioned virtually anywhere you want on the screen?

Re: Axes in the center of the graph

Posted: Mon Jan 22, 2018 6:50 am
by ArctionKestutis
Yes, as it is shown in above example. Please set OFF corresponding chart.ViewXY.AxisLayout.?AxisAutoPlacement and set Position (Axes.Position as percents of chart width or height).