Jump to content
Software FX Community

New Y Axis in second Pane


Pat
 Share

Recommended Posts

The code is below;

case "New Y Axis":   Label1.Text = " Case Y2 Axis: ";   if (Chart1.Series[DropDownSeries.SelectedIndex].AxisY == Chart1.AxisY2)   {   Chart1.Personalize.AutoLoad = false;   Label1.Text = Label1.Text + "  If Condition matched, selected series axis " + Chart1.Series[DropDownSeries.SelectedIndex].AxisY;   break;   }   else   {   Chart1.Personalize.AutoLoad = false;   //Chart1.Series[DropDownSeries.SelectedIndex].AxisY = Chart1.AxisY[3];   //Chart1.Series[DropDownSeries.SelectedIndex].Pane = Chart1.Panes[1];

  AxisY AddlAxisY = new AxisY();   AddlAxisY.TextColor = Chart1.Series[DropDownSeries.SelectedIndex].Color;   AddlAxisY.Visible = true;   AddlAxisY.Position = AxisPosition.Far;   AddlAxisY.ForceZero = false;   Chart1.AxesY.Add(AddlAxisY);   Chart1.Series[DropDownSeries.SelectedIndex].AxisY = AddlAxisY;

When I try to specify a Pane it does not generate the graph;

Chart1.Series[DropDownSeries.SelectedIndex].Pane = Chart1.Panes[1];

Link to comment
Share on other sites

The semantics of:

Chart1.Series[DropDownSeries.SelectedIndex].Pane = Chart1.Panes[1];

Is to move the series to the main Y-Axis of the second pane.

Since you already assigned the series to the right axis, what you need to do now is to add that axis to the appropriate pane, not to the Main pane.

Replace: 

 Chart1.AxesY.Add(AddlAxisY);

With:

Chart1.Panes[1].AxesY.Add(AddlAxisY);

 Remove:

Chart1.Series[DropDownSeries.SelectedIndex].Pane = Chart1.Panes[1];

Link to comment
Share on other sites

  • 2 weeks later...

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