in

Software FX Community

Discuss and find help for all Software FX products.

Assigning Statistical study to Secondary Y-Axis

Last post 01-19-2010 5:14 PM by rms2219. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 01-19-2010 5:14 PM

    Assigning Statistical study to Secondary Y-Axis

    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.
Page 1 of 1 (1 items)
Copyright 2008 Software FX, Inc.