Why right side axis Y is in chart's view when set margin

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
Harry943
Posts: 8
Joined: Tue Dec 26, 2017 6:46 am

Why right side axis Y is in chart's view when set margin

Post by Harry943 » Tue Jan 09, 2018 1:52 am

Hello, I get a question when set axis position. I set ViewXY's margin, disable AutoAdjustMargins and set YAxisAutoPlacement to AllRight, but the result not as what I thought: The Y Axis is in view
The xaml Code below:

Code: Select all

    <Grid>
        <lcusb:LightningChartUltimate Content="LightningChartUltimate">
            <lcusb:LightningChartUltimate.ViewXY>
                <lcusb:ViewXY Margins="50">
                    <lcusb:ViewXY.AxisLayout>
                        <lcusb:AxisLayout AutoAdjustMargins="False" YAxisAutoPlacement="AllRight"  XAxisAutoPlacement="AllTop"/>
                    </lcusb:ViewXY.AxisLayout>
                    <lcusb:ViewXY.YAxes>
                        <lcusb:AxisY/>
                    </lcusb:ViewXY.YAxes>
                    <lcusb:ViewXY.XAxes>
                        <lcusb:AxisX/>
                    </lcusb:ViewXY.XAxes>
                </lcusb:ViewXY>
            </lcusb:LightningChartUltimate.ViewXY>
        </lcusb:LightningChartUltimate>
    </Grid>
The x axis behave normal but the y axis is not.
I knew that enable AutoAdjustMargins don't have this problem, but I should set solid margin for special requirement.
Can this be solve? Thx.
Attachments
123.png
123.png (39.74 KiB) Viewed 6067 times

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

Re: Why right side axis Y is in chart's view when set margin

Post by ArctionKestutis » Tue Jan 09, 2018 8:20 am

Hello,

I guess you want YAxis labels and Title to be on the right. For that you need to set corresponding properties

Code: Select all

                            <lcusb:AxisY.Title>
                                <lcusb:AxisYTitle HorizontalAlign="Right"/>
                            </lcusb:AxisY.Title>
                            <lcusb:AxisY.MajorDivTickStyle>
                                <lcusb:AxisTickStyle Alignment="Far"/>
                            </lcusb:AxisY.MajorDivTickStyle>
All the best.

Harry943
Posts: 8
Joined: Tue Dec 26, 2017 6:46 am

Re: Why right side axis Y is in chart's view when set margin

Post by Harry943 » Wed Jan 10, 2018 2:33 am

Thx, it works!

Post Reply