Hi,
I was not able to reproduce the date in the sample found on this documentation. I want my chart date look like the one here https://ej2.syncfusion.com/angular/demos/#/material/chart/overview-chart
See codes and its output below that l have tried when l bind my chart to the server
Output
Since on the chart is for this one is 2021 and 2022, so the chart should be accumulated into two columns. Kindly assist
Regards
Charles
Hi Charles,
Greetings from Syncfusion.
We have created an angular application based on your requirement by setting the valueType property in primaryXAxis as DateTime, labelFormat property as yyyy, and intervalType as Years. Please find the below stackblitz link for your reference.
Sample link: https://stackblitz.com/edit/angular-a3xvsv-vekz4q?file=app.component.ts
Code Snippet:
public chartData: Object[] = [ { x: new Date(2017, 1, 1), y1: 60 }, { x: new Date(2018, 2, 1), y1: 56 }, { x: new Date(2019, 3, 1), y1: 71 }, { x: new Date(2020, 4, 1), y1: 85 }, { x: new Date(2021, 5, 1), y1: 73 } ];
public primaryXAxis: Object = { valueType: 'DateTime', labelFormat: "yyyy", intervalType: "Years", interval: 1, majorGridLines: { width: 0} }; |
Screenshot:
Kindly, revert us if you have any concerns.
Regards,
Swetha