Jump to content
Software FX Community

AxesStyle = Math with no y2 axis displayed


anneslyon
 Share

Recommended Posts

Hello!

I have a chart where I plot series against both Y axis and Y2 axis. The axesStyle is set to Math. Sometimes the user needs to hide the series plotted on the Y2 axis, and hence hide the Y2 axis too. This is done by simply setting the Chart.series(1).Visible = false and Chart.AxisY2.Visible = False. This partly works as labels and tickmarks disappear on the Y2 axis, but the line itself remains.

Setting Chart.AxisY2.Line.Color = Color.Transparent does not do anyting,

while Chart.AxisY.Line.Color = Color.Red sets BOTH Y and Y2 axis to red!

How do I remove the y2 axis line so that only the X and Y axis are displayed? OR how do I set the line style for Y and Y2 axis independently?

Anne

Link to comment
Share on other sites

 Anne you are right. There is an issue related to the AxisY2 and is has been reported to our development team. However we can add an additional Y Axis (you can add more if you like) and handle it apart.

 Change AxisX Settings

  chart1.AxisX.TextColor = chart1.Series[0].Color; // because i want the same color of the first series
  chart1.AxisX.Line.Color = chart1.Series[0].Color; // you can change this color at will.
  chart1.AxisX.Visible = true;
  chart1.AxisX.Position = AxisPosition.Far;
  chart1.AxisX.ForceZero = false;

 Add New Axis Y and Change New AxisY Settings

  AxisY AddlAxisY = new AxisY();
      AddlAxisY.TextColor = chart1.Series[0].Color;
  AddlAxisY.Line.Color = chart1.Series[0].Color;
  AddlAxisY.Visible = true;
      AddlAxisY.Position = AxisPosition.Far;
      AddlAxisY.ForceZero = false;
      chart1.AxesY.Add(AddlAxisY);
      chart1.Series[0].AxisY = AddlAxisY; // we assign the series to the new axis.

 

I hope this solves it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...