Get slope before generating the chart

Hello guys,

Is there a way to calculate the slope of trendline based on the chart data without having to load the chart?

For example:

List chartData= [];

Calculations.getSlope(chartData);

Thanks in advance.

Greetings Leon.


1 Reply

SK Sriram Kiran Senthilkumar Syncfusion Team March 24, 2022 01:08 PM UTC

Hi Leon, 
 
Greetings from Syncfusion. Currently, there is no direct way to get the slope of the trendline based on chart data without having to load the chart. However, you can be able to use the onRenderingDetailsUpdate callback available in the Trendline to retrieve the slope values, but this will be fired on load time on the chart only. Please check the user guide below for reference. 
 
If you want to get the slope of the trendline based on the chart data before loading the chart, then you will have to create a function externally to calculate the slope values based on the chart data source as per your requirement and use to get the slope values. 
 
Regards, 
Sriram Kiran 


Loader.
Up arrow icon