Ejs-chart string format

Hello Syncfusion team, I have a few questions regarding ejs-chart. Thanks in advance for your assistance.


I have  a situation where the chart is displaying properly when I push a new DateTime of locale (en-US) in String format into the chart.ej2_instances[0].series.dataSource in JavaScript every second. However, when I try to push the DateTime of locale (en-GB) in String format into the chart.ej2_instances[0].series.dataSource in JavaScript every second, the chart is not displaying the DateTime in the X-axis of the chart and cannot display any other data as well. 


My questions are as follows:

1) Can I push the String format of DateTime from other locale (For eg. en-GB, en-AU) instead of String format of DateTime (en-US) into chart.ej2_instances[0].series.dataSource as the xValue or yValue of ejs-chart using JavaScript in ASP.Net Core?


2) Do ejs-chart only receive default locale (en-US) DateTime in String format for the DataSource of e-series?



1 Reply

DG Durga Gopalakrishnan Syncfusion Team October 27, 2021 04:10 PM UTC

Hi Weng, 
  
Greetings from Syncfusion.  
  
We have analyzed your reported queries. You can specify the date in string format by following the standard JavaScript date formats. As of now, only below formats are supported. We have prepared sample with en-GB culture. Please check with below snippet and sample. 
  
<ejs-chart locale="en-GB"></ejs-chart> 
<script> 
    window.onChartLoad = function (args) {  
        args.chart.series[0].dataSource = 
            [ 
            { x:'9/27/2021 01:10', y: 210000 }, 
            { x:'9/27/2021 02:12', y: 240000 }, 
            //.. 
        ]; 
    } 
loadCultureFiles("en-GB"); 
ej.base.setCulture("en-GB"); 
</script> 
  
  
 
  
  
  
  
Please let us know if you have any concerns. 
  
Regards,  
Durga G 


Loader.
Up arrow icon