This project is read-only.

Multiple Y axis: axis label not showing full values overlapping from right

May 11, 2015 at 7:11 AM
Edited May 11, 2015 at 7:12 AM
hi,

when i am trying to plot dual axis chart, axis label values cutting from right in both axis. i am applying axis label style.

LinearAxis y = new LinearAxis() { Orientation = AxisOrientation.Y, Location = AxisLocation.Left, Minimum = YMinValue, Maximum = YMaxValue,Interval=YInterval};
y.FontSize = 10;
y.ShowGridLines = true;
y.Margin = new Thickness(0);
y.Foreground = new SolidColorBrush(Colors.Black);
Style st1 = new Style(typeof(AxisLabel));
st1.Setters.Add(new Setter(AxisLabel.StringFormatProperty, "{0:G}"));
st1.Setters.Add(new Setter(AxisLabel.FontSizeProperty, "10"));
st1.Setters.Add(new Setter(AxisLabel.ForegroundProperty, "Black"));
y.AxisLabelStyle = st1;
this.ScatterChart.Axes.Add(y);

Style st2 = new Style(typeof(AxisLabel));
st2.Setters.Add(new Setter(AxisLabel.StringFormatProperty, "{0:N}"));
st2.Setters.Add(new Setter(AxisLabel.FontSizeProperty, "10"));
st2.Setters.Add(new Setter(AxisLabel.ForegroundProperty, "Black"));
LinearAxis y2 = new LinearAxis() { Orientation = AxisOrientation.Y, Location = AxisLocation.Right, Minimum = Y2MinValue, Maximum=Y2MaxValue,Interval=Y2Interval };
y2.Margin = new Thickness(0);
y2.FontSize = 10;
y2.AxisLabelStyle = st2;
y2.ShowGridLines = false;
y2.Foreground = new SolidColorBrush(Colors.Black);
this.ScatterChart.Axes.Add(y2);

please find the attached chart image
Image
or link
Link