Hi,
I am using a chart and I want to add a trendline for this chart.
I use your example: https://ej2.syncfusion.com/aspnetcore/Chart/TrendLines#/bootstrap5
And it works well.
Then I have changed the x axis for a datetime axis:
For that, I have added the value type for the x axis of the chart:
<e-chart-primaryxaxis valueType="DateTime" edgeLabelPlacement="Shift">
<e-majorgridlines width="0"></e-majorgridlines>
</e-chart-primaryxaxis>
And I have changed the series values with :
var series1 = [ { x: "2022-01-04T00:00:00", y: 0 }, { x: "2022-02-07T00:00:00", y: 1 }, { x: "2022-03-31T10:00:00", y: 2 }, { x: "2022-04-09T00:00:00", y: 3 } ];
The chart is loaded, and the trendline also:
When I use the forward forecast feature, the chart is refreshed but I don't see the trends for the new values on the graph.
To be clear, in your example, when we use the forward forecast feature, we see the trends for 2014/2015/...
Do you have an example that works with datetime x-axis?
Best regards,
Laurent
Hi Laurent,
Greetings from Syncfusion.
We suggest you to specify forecast values in milliseconds for date time axis. We have prepared sample based on your requirement. Please check with below snippet and sample.
|
<ejs-chart > <e-series-collection> <e-series> <e-series-trendlines> <e-trendline forwardForecast="114679000000"> </e-trendline> </e-series-trendlines> </e-series> </e-series-collection> </ejs-chart> |
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Forecast1852970858.zip
Please let us know if you have any concerns.
Regards,
Durga Gopalakrishnan.
Thanks!
Hi Laurent
Most welcome. Kindly get in touch with us, if you would require further assistance. We are always happy in assisting you.
Regards,
Sridevi Bharathi.
Thanks for the answer.
Hi Ellie,
Please get back to us if you would require further assistance.
Regards,
Swetha
Thanks Swetha. I will for sure.
Okay.