Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Adding Trend Line to Report Chart

C# Script

private void chart1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)

{

            Series aSeries = ((XRChart)sender).Series[0];

            TrendLine aTredLine = ((LineSeriesView)aSeries.View).FinancialIndicators.TrendLines[0];

            aTredLine.Point1.Argument = aSeries.Points[0].Argument;

            aTredLine.Point2.Argument = aSeries.Points[aSeries.Points.Count - 1].Argument;

}

 

If your chart is a bar chart change ‘LineSeriesView’ to ‘BarSeriesView’ in the second line of code

Click on Chart Line you want to add trendline for in the designer

 

 

In the property grid for the line go to the elements section, expand View.  Select Indicators and a pop up box will appear.

Select Add and another pop up will appear.

Select Trend Line and hit ok

 

It will then give you a trend line property grid.  Make appropriate changes such as changing the trend line color and hit close.

 

Save and run your report.

 

Example:

 

  • No labels