Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1015
Y2 Axis Stroke drawn on wrong side of the screen
posted

I have a series on the xamDataChart that is being rendered properlu on the Y1 axis, but if I select the Y2 axis, the axis stroke is on the wrong side of the screen. The only difference between the two axis is the Label settings which state which side of the graph labels should be located.

So what am I doing wrong?

Y2 Axis stroke rendered on wrong side of chart

Parents
No Data
Reply
  • 1015
    posted

    And Here is my axis initialization code. Note the underlined section is the only difference between my Y1 axis code and my Y2 axis code.

    private void axisInitialization()
    {

    AxisLabelSettings rightAxisSettings = new AxisLabelSettings();
    TitleSettings y2AxisTitleSettings = new TitleSettings();

    SolidColorBrush axisBrush = new SolidColorBrush(Colors.Black);
    SolidColorBrush transparentBrush = new SolidColorBrush(Colors.Transparent);


    y2AxisTitleSettings.Foreground = axisBrush;
    y2AxisTitleSettings.FontFamily = new FontFamily("Segoe UI");
    y2AxisTitleSettings.Angle = -90;


    rightAxisSettings.FontFamily = new FontFamily("Segoe UI");
    rightAxisSettings.Foreground = axisBrush;
    rightAxisSettings.Margin = new Thickness(5);
    rightAxisSettings.Location = AxisLabelsLocation.OutsideRight;

    numericY2Axis.TickLength = 7;
    numericY2Axis.MajorStroke = transparentBrush;
    numericY2Axis.TickStroke = axisBrush;
    numericY2Axis.Stroke = axisBrush;
    numericY2Axis.Name = "y2Axis";
    numericY2Axis.Label = "{:E2}";

    numericY2Axis.LabelSettings = rightAxisSettings;
    numericY2Axis.TitleSettings = y2AxisTitleSettings;

    numericY2Axis.Visibility = Visibility.Visible;

    AxisCollection.Add(numericY2Axis);

    }

Children