Axes in the center of the graph

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
bkahlen
Posts: 3
Joined: Mon Mar 31, 2014 9:16 pm

Axes in the center of the graph

Post by bkahlen » Sun Dec 31, 2017 3:59 pm

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.
Attachments
31-12-_2017_16-57-48.png
31-12-_2017_16-57-48.png (69.55 KiB) Viewed 11677 times

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

Re: Axes in the center of the graph

Post by ArctionPasi » Mon Jan 01, 2018 3:03 pm

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 11672 times
LightningChart Support Team, PT

Tichelin
Posts: 1
Joined: Fri Jan 12, 2018 9:40 am

Re: Axes in the center of the graph

Post by Tichelin » Sun Jan 21, 2018 12:20 pm

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?
Last edited by Tichelin on Mon Dec 13, 2021 11:07 am, edited 2 times in total.

ArctionKestutis
Posts: 552
Joined: Mon Mar 14, 2016 9:22 am

Re: Axes in the center of the graph

Post by ArctionKestutis » Mon Jan 22, 2018 6:50 am

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).

Post Reply