Column chart with DateTime X-axis throws error if series contains only one item

Hi,
my Column chart throws an error when the series contains only one item.

The x-axis settings are:
this.primaryXAxis = {
valueType: 'DateTime',
labelFormat: 'dd.MM',
interval: 1,
majorGridLines: {
width: 0
},
majorTickLines: {
width: 0
},
lineStyle: {
color: 'transparent'
}
};

And the error is this one:
TypeError: Cannot read property 'min' of undefined at eval (ej2-charts.es5.js:2161) at Array.forEach (<anonymous>) at getMinPointsDelta (ej2-charts.es5.js:2150) at DateTime.Double.calculateRange (ej2-charts.es5.js:619) at DateTime.calculateRangeAndInterval (ej2-charts.es5.js:8345) at CartesianAxisLayoutPanel.measureDefinition (ej2-charts.es5.js:3241) at CartesianAxisLayoutPanel.measureColumnAxis (ej2-charts.es5.js:3219) at CartesianAxisLayoutPanel.measureAxis (ej2-charts.es5.js:3173) at ChartComponent.Chart.calculateBounds (ej2-charts.es5.js:6921) at ChartComponent.Chart.refreshBound (ej2-charts.es5.js:6699)

Could you please help me with this?
Thanks

10 Replies

BP Baby Palanidurai Syncfusion Team July 3, 2018 08:44 AM UTC

Hi Sarah,
 
   We can reproduce the reported scenario at our end. When using date time for x axis and single points with column. So we have logged a bug report “Issue while using date time x axis with column for single points”, we will fix this issue and the fix will be included in the next patch release which is expected on 10 July, 2018.
 
Thanks,
Baby.



BP Baby Palanidurai Syncfusion Team July 10, 2018 12:26 PM UTC

Hi Sarah, 
  
We are glad to announce that our v16.2.44 patch release is rolled out, we have added the fix for “Issue while using date time x axis with column for single points” issue and is available for download under the following link. 
  
  
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
  
Thanks,          
Baby. 



SR Sarah Riethmüller July 16, 2018 02:11 PM UTC

Hi,
there error is still after the update occuring for me.
I also got this bug here too:


If the series contains two items the x-axis seems to be glitchy.

Thanks
Sarah


SR Sarah Riethmüller July 16, 2018 02:50 PM UTC

I've got multiple series in my chart. 
TypeError: Cannot read property 'min' of undefined
occurs if one or more of this series contains one element but y-value is 0!
But I still want to display the other series!
Then the whole chart is not visible anymore.
Could you please help me with this?


SR Sarah Riethmüller replied to Sarah Riethmüller July 16, 2018 04:06 PM UTC

Hi,
there error is still after the update occuring for me.
I also got this bug here too:


If the series contains two items the x-axis seems to be glitchy.

Thanks
Sarah

Hi, 

this ui bug occors if they are one or two items in a series:




BP Baby Palanidurai Syncfusion Team July 17, 2018 09:18 AM UTC

Hi Sarah, 

We have analyzed your query and we have prepared a sample and checked the below scenario at our end, all the scenarios are working fine. Please find the sample below. 

Single point with single series 
Sample link: 

Screenshot: 
 

Two point in single series 
Sample Link: 

Screenshot: 
 
Multiple series with single points and set y values as 0 for some of the series. 
Sample Link: 

Screenshot: 
 


  We are not aware about the scenario, in which the issue got reproduced, we have passed data for chart in different format and its working fine. So kindly share your data or change the above sample to replicate the issue, which will be helpful in further analysis and provide you the solution sooner. 
  
Kindly revert us, if you have any concerns. 
  
Thanks, 
Baby. 



SR Sarah Riethmüller July 22, 2018 06:48 PM UTC

Hi, 
I removed the interval property from my x-axis and now I got this x-axis problem for 1-3 entries in the column. I still have 3 data series.
All three data series have the same x-values but different y-values. 
The chart type is StackingColumn.
Now I have the same dates in my x-axis twice or three times.
Also the axis labels seem to be not correct because my data starts with 16.07.
The datasources I used for this is:
datasource 1: 
{[{
"date": Mon Jul 16 2018 00:00:00 GMT+0200 (Central European Summer Time)
"y": 0
},
{
"date": Tue Jul 17 2018 00:00:00 GMT+0200 (Central European Summer Time)
"y": 188
},
{
"date": Wed Jul 19 2018 00:00:00 GMT+0200 (Central European Summer Time)
"y": 222
}
]
}

datasource 2: 
{[{
"date": Mon Jul 16 2018 00:00:00 GMT+0200 (Central European Summer Time)
"y": 62
},
{
"date": Tue Jul 17 2018 00:00:00 GMT+0200 (Central European Summer Time)
"y": 0
},
{
"date": Wed Jul 19 2018 00:00:00 GMT+0200 (Central European Summer Time)
"y": 0
}
]
}

datasource 3: 
{[{
"date": Mon Jul 16 2018 00:00:00 GMT+0200 (Central European Summer Time)
"y": 0
},
{
"date": Tue Jul 17 2018 00:00:00 GMT+0200 (Central European Summer Time)
"y": 0
},
{
"date": Wed Jul 19 2018 00:00:00 GMT+0200 (Central European Summer Time)
"y": 0
}
]
}

It works fine if all series have a number of entries bigger than 3.

Thanks
Sarah


BP Baby Palanidurai Syncfusion Team July 23, 2018 11:51 AM UTC

Hi Sarah, 

Please find the following response for your queries, 

Queries 
Response 
I removed the interval property from my x-axis and now I got this x-axis problem for 1-3 entries in the column. 
We have analyzed your query. By default, based on data to series and size of the chart, datetime axis will calculate the auto interval type and interval. In your sample, difference of data is in hours, so the chart will calculate the intervalType either as “Hours” or “Minutes” based on chart size and the interval will be from 1 to 24. When you set the interval as 1, it will work for hours, but when the interval type is Minutes, then the interval 1 will generate more number of labels and hence the axis trims all the labels to place them. So we recommend not to set the interval alone, when the intervalType is calculated automatically. 
The chart type is StackingColumn. 
Now I have the same dates in my x-axis twice or three times. 
Also the axis labels seem to be not correct because my data starts with 16.07. 


When its column type chart, we will add padding to the axis based on interval to avoid the column rect cropping at the end. 

 
And hence the axis label starts from 15th July, but the point got plotted on 16th July only, you can enable the tooltip to get the detail about the point. 

To overcome this, you can set minimum and maximum for the axis based on you data. 

Sample for your reference can be find from below link, 

Screenshot 

 



Kindly revert us, if you have any queries. 

Thanks, 
Baby. 



SR Sarah Riethmüller July 24, 2018 06:48 AM UTC

Hi,
thanks for your quick response.
I changed the intervalType to dates and now it works like charm except for one entry.
For one entry I got this error:
ERROR TypeError: Cannot read property 'min' of undefined
    at eval (ej2-charts.es5.js:2161)
    at Array.forEach (<anonymous>)
    at getMinPointsDelta (ej2-charts.es5.js:2150)
    at DateTime.Double.calculateRange (ej2-charts.es5.js:619)
    at DateTime.calculateRangeAndInterval (ej2-charts.es5.js:8345)
    at CartesianAxisLayoutPanel.measureDefinition (ej2-charts.es5.js:3241)
    at CartesianAxisLayoutPanel.measureColumnAxis (ej2-charts.es5.js:3219)
    at CartesianAxisLayoutPanel.measureAxis (ej2-charts.es5.js:3173)
    at ChartComponent.Chart.calculateBounds (ej2-charts.es5.js:6921)
    at ChartComponent.Chart.refreshBound (ej2-charts.es5.js:6699)

I want to change the number of entries on runtime.
Thanks
Sarah


BP Baby Palanidurai Syncfusion Team July 25, 2018 08:44 AM UTC

HI Sarah, 

     We have analyzed your query. As per your requirement we have prepared a sample with single point and we have checked with different interval types, unfortunately we are unable to reproduce the reported scenario at our end and the sample is working fine. Sample used for testing can be find from below link, 


Screenshot: 
 

We are not aware about the scenario, in which the issue got reproduced, we have passed the single point from data which you shared in the previous update and checked with different interval types(Year, Month, Minutes, Days, Hours) for axis and its working fine. So kindly share your details about data, interval type, interval and format to the axis or change the above sample to replicate the issue, which will be helpful in further analysis and provide you the solution sooner. 
  
Kindly revert us, if you have any concerns. 
  
Thanks, 
Baby. 


Loader.
Up arrow icon