Jump to content
Software FX Community

How to add a trend line to an existing chart?


aruni

Recommended Posts

Hi,

 I am using ChartFX for displaying a line chart. As I need to dispaly a trend line based on these series we purchased the ChartFX extension pack.

How can I add the trend line to the existing chart programmatically?

 

Regards,

Link to comment
Share on other sites

The statistical extension provides trend-line functionality.

You simply need to:

1) Add the extension to the chart (either pragmatically or at design-time)

2) Add a LinearRegression study.

Examples of this can be found in the Statistical Extension documentation.

Link to comment
Share on other sites

Hi,

Thanks for the reply. 

As mentined I am having a LINE chart which dispalys data for 6 months.

Now I need to add a TREND LINE for the same as you are adding it in Microsoft Excel.

Even if I bind the Chart to the financial it changes my chart.

Appreciate if you can guide me how to add the trend line to a normal simple line chart.

 

Regards,

 

 

Link to comment
Share on other sites

Like I sai in my previous posting, you need to use the  statistical extension (not the financial extension).

To add the trendline you simply do:

StudyInteractive study = (StudyInteractive) statistics.Studies.Add(Analysis.RegressionLine);

study.Visible =

true;There is extensive documentation (includding this code) about the statistical extension included with the product.
Link to comment
Share on other sites

Hi Francisco,

 

Thanks a lot for the reply. I just copied your code and I think it's working fine. I will dig into it more.

You have done a great help for me.

But unfortunatly I didn't find any code related to the same in the documentation.

[Appreciate if you can tell me the place that I should lookinto]

Regards,

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...