Error: <path> attribute d: Expected number, "MNaN,NaNLNaN,NaNA…"

7,242 views
Skip to first unread message

Shinwoo Kang

unread,
Jun 13, 2017, 5:17:52 AM6/13/17
to Google Visualization API
Hi,

I am using google visualization for various charts.

I tried to draw piecharts with array data but I got the error when I use draw().
The problem is that I got the error randomly and rarely even though the array data is same.

Is there someone who have any ideas about it?

Below is my work.

--------------------------------------------------------------------------------------------------------------------------------------------------------
var pieDataArr = [["test1", 2], ["test2", 1], ["test3", 1], ["test4", 1], ["test5", 0]];
var data = google.visualization.arrayToDataTable(pieDataArr);

var options = {
title : titleOption,
titleTextStyle : {
fontSize : 15
},
width : chartWidth,
height : 400,
chartArea:{
top : 20,
width : chartWidth*0.6,
height : 360
},
bar : {
groupWidth : 25
},
hAxis : {
maxValue : 100,
viewWindow : {
max : 100
}
},
vAxis : {
textStyle : {
fontSize : 12
}
},
'backgroundColor' : '#f0f3f7',
legend:{
position : 'bottom'
},
pieSliceTextStyle : {
color : '#2c3520'
},
pieHole : 0.4,
colors :colorMap
};

var chart = new google.visualization.ChartWrapper({
chartType : 'PieChart',
dataTable : data,
options : options,
containerId : chartId_
});

chart.draw();

Daniel LaLiberte

unread,
Jun 13, 2017, 8:48:20 AM6/13/17
to Google Visualization API
Your example appears to work fine here (after adding header row to your data):  https://jsfiddle.net/dlaliberte/97278v8g/
But you didn't specify which version you were loading, or how, which could make a difference in how it loads. 

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/6983c701-b097-4cff-b701-0edd22a89c35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Shinwoo Kang

unread,
Jun 13, 2017, 10:29:07 PM6/13/17
to Google Visualization API
Thank you for the checking.

I use like below.

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
google.charts.load('current', {packages: ['corechart']});
google.charts.setOnLoadCallback(fetchData);

My chart is working at the first time and the error gets randomly when I redraw the chart.
The error is "Error: <path> attribute d: Expected number, "MNaN,NaNLNaN,NaNA…""
And the error at below
gvjs_.zZ=function(a,b){var c=this.qb(gvjs_sw);0<a.length&&c.setAttribute("d",a.join(""));this.Aj(c,b);return c};
in https://www.gstatic.com/charts/45.1/js/jsapi_compiled_format_module.js


Looks like parsing problem but the example data case is same.
var pieDataArr = [ ['Test', 'Num'], ["test1", 2], ["test2", 1], ["test3", 1], ["test4", 1], ["test5", 0] ];

Do you have any idea about the error?

Shinwoo Kang


2017년 6월 13일 화요일 오후 9시 48분 20초 UTC+9, Daniel LaLiberte 님의 말:
To post to this group, send email to google-visua...@googlegroups.com.



--

Daniel LaLiberte

unread,
Jun 14, 2017, 9:17:47 AM6/14/17
to Google Visualization API
The error is about an SVG element not liking an attribute value which is supposed to be a number.  I would bet your actual data sent to the chart is not what you believe it is.  

You should also draw a Table chart (before the PieChart) with the same data to see what it shows when the error occurs.  Or you might be able to use a debugger to work backwards to the data that resulted in the error.  If you can point me an your web page that shows this problem, I might be able to help more.


To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com.



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Shinwoo Kang

unread,
Jun 15, 2017, 2:38:54 AM6/15/17
to Google Visualization API
Thank you for your support Daniel,

I also draw a Table chart before the PieChart.
I confirmed the data is same but there is only errored at the PieChart.
I hope to send you the web page but it is an administrator part so hard to open.

During the test today, I realized the error has occurred in my Macbook.
So I checked 7 other computers (windows and mac as well)
All of the computers were fine when Chrome browser is not updated(ver 59). There are some were ver.57 and some were ver.58.
And after updating all the computer's Chrome version to the latest version(ver59), I can check the error on other computers as well.

You mentioned that the error is about an SVG element and I checked, at the Chrome ver.59, there is an SVG spec is removed (deprecated in ver.54).
Do you think that is related to the problem?

I didn't develop the part but I used to maintain the chart over 2 years and there is no problem like this. But I realized the error a few days ago.
I am not sure that this is your role or not.
Would you please give me some advice about this problem that is related Chrome version?



2017년 6월 13일 화요일 오후 6시 17분 52초 UTC+9, Shinwoo Kang 님의 말:

Daniel LaLiberte

unread,
Jun 15, 2017, 8:42:06 AM6/15/17
to Google Visualization API
Browsers do have bugs, but this unpredictable behavior sounds rather strange.  You might try removing browser add-ons as well.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.

Patrick Archibald

unread,
Jun 19, 2017, 4:47:04 PM6/19/17
to Google Visualization API
I started getting the "Expected number, "MNaN,NaNLNaN,NaNA…" error randomly a couple of weeks ago. I haven't been able to find the root cause. The data looks fine. Screenshot 2  below is from a Chromebook when it working. When I get the error my charts are gone but the labels still show (see screenshot 1 on Ubuntu). I assumed it was a Google Visualization bug and would be fixed by now. Bad assumption. I am going to run this on a Chromebook for an extended period of time to see if the error occurs there. My desk machine is Ubuntu 16.04 with Chrome Version 59.0.3071.86. 




Shinwoo Kang

unread,
Jun 20, 2017, 12:45:33 AM6/20/17
to Google Visualization API
I am not sure what is the problem is.
But I have checked several computers that are windows / macOS and Chrome / other browsers without add-ons and reinstalling, 
and I think the Chrome version 59.0.3071.68 has a problem about this error.
Because there is no error at Chrome 60 (Dev ver.) and 61(Canary ver.).

Now, I am waiting for updating Chrome 60 stable version soon.



2017년 6월 13일 화요일 오후 6시 17분 52초 UTC+9, Shinwoo Kang 님의 말:
Hi,

Amit Bhagat

unread,
Jun 24, 2017, 6:58:36 PM6/24/17
to Google Visualization API
Hi,

I am using angular-google-chart to draw multiple Pie charts on a page and was getting same Error: <path> attribute d: Expected number, "MNaN,NaNLNaN,NaNA…" at the line "c.setAttribute("d", a.join(""))" in Visualization api's js.

In the first load of the page all Pie charts would display properly, but when tried to reload them with different data the above error would throw several times and some charts would not load whereas some would load partially.

When I tried checking my Chrome version, it got updated by itself to "Version 59.0.3071.109 (Official Build) (64-bit)" and the problem was resolved.

Вилюс Бруздейлинас

unread,
Jan 14, 2020, 10:08:26 AM1/14/20
to Google Visualization API
I've had a very similar issue with Timeline chart. The problem was because of the same start and end dates in my data, under some circumstences the library could not draw the chart with 'Expected number, "MNaN,..." ' exception. When I fixed the charts data so that intervals were at least 1 minute long the problem disappeared. I am not 100% sure though that it is related to your problem. 
 
Reply all
Reply to author
Forward
0 new messages