Jump to content
Software FX Community

New Y Axis in second Pane


Pat

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...