X-axis time setting?

Hi,

After the X-axis is set to the time format, the x-worth time format of the point must be the international standard time?
If I don't convert the time format to the international standard format time, the page will report a jQuery error.

Can you give some advice to solve the problem of time?

Thanks



3 Replies

BP Baby Palanidurai Syncfusion Team July 12, 2018 09:52 AM UTC

Hi Linsee, 
  
We have analyzed your query and chart supports only international standard time format. If you want to use other than date object for charts date time axis, you need to parse the data into date object before providing to chart. In charts we can parse the data accordingly in load event. We have prepared a sample based on your requirement. In that sample we have parsed the data’s in load event.  
Please find the  below code snippet to achieve this requirement, 
$("#container").ejChart( 
        { 
                                                 
            //Initializing Series                                                              
            series:  
                [ 
                    { 
                points: [ 
                  { x: '04:51:00', y: 28 },  
                  { x: '04:55:00', y: 25 }, 
                  { x: '04:58:00', y: 26 },  
                  { x: '05:03:00', y: 27 },  
                  { x: '05:08:00', y: 32 },  
                  { x: '05:12:00', y: 35 }], 
                } 
          ], 
          load: function (args)  { 
                var serLen = args.model.series.length; 
                for(var i =0; i < serLen; i++ ){ 
                      var pointLength = args.model.series[i].points.length; 
                      for (var j =0; j < pointLength; j++){ 
                         args.model.series[i].points[j].x = ej.parseDate(args.model.series[i].points[j].x, "hh:mm:ss");  
                     } 
                }  
          } 
        }); 
Screenshot: 
 
Sample for your reference can be find from below link, 
Kindly revert us, if you have any queries. 
 
Thanks, 
Baby. 



LI linsee July 13, 2018 06:52 AM UTC

Hi Baby,

Thank you for your help!I have another question to ask, can you answer it?

Thanks,
Linsee.


BP Baby Palanidurai Syncfusion Team July 16, 2018 11:32 AM UTC

Hi Linsee, 

We have provided the solution for your query on forum #138700, kindly follow up the forum for further assistance. 
                                                 
Thanks, 
Baby. 


Loader.
Up arrow icon