Jump to content
Software FX Community

Assigning Statistical study to Secondary Y-Axis


rms2219

Recommended Posts

Hello...I have 3 series on a chart. The 3rd series is attached to a second Y-Axis like so:

laborCategoryChart.Data.Series = 3;

AxisY profitAxis = new AxisY();

profitAxis.Visible = true;

profitAxis.Position = AxisPosition.Far;

profitAxis.ForceZero = false;

laborCategoryChart.AxesY.Add(profitAxis);

laborCategoryChart.Series[2].AxisY = profitAxis;

laborCategoryChart.Series[2].Text = "Profitability";

laborCategoryChart.Series[2].Gallery = Gallery.Lines;

Now, my problem is that I need to add a regression line to that 3rd series. I attempt to do this like this:

Statistics stats = new Statistics();

stats.Studies.Add(Analysis.RegressionLine);

stats.Chart = engChart;

stats.SelectedSeries = 3;

StudyLine study = (StudyLine)stats.Studies.Find(StudyType.Analysis, (int)Analysis.RegressionLine);

study.Text = "Trend line";

study.Line.Color = System.Drawing.Color.DarkOrange;

study.Line.Width = 3;

study.Line.Style = System.Drawing.Drawing2D.DashStyle.Solid;

study.Bold = true;

study.Visible = true;

study.Behind = false;

The problem is that it always just creates a regression line for the 2nd series (the last series on the first Y-Axis). It seems like the statistic analysis is only does on the first Y-Axis instead of the second. Please help.

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.

×
×
  • Create New...