Error in Bar chart: Unknown renderer type

101 views
Skip to first unread message

Tushar Patel

unread,
Feb 24, 2020, 9:14:28 AM2/24/20
to Google Visualization API
Hi, I am getting error of Unknown renderer type 
as
Before it was working good. I think after recent update on google chart it cause issue.
Please have a look to my code and help me to debug it.

google.charts.setOnLoadCallback();
var data = google.visualization.arrayToDataTable(data_res.data);
 var options = {
 chart: {
   title: '',
   subtitle: '',
 },
  colors: ['#050896','#468A3D','#E67712','#1962AA','#89519C','#D94810','#A72B4E','#6765C5','#212529'],
   bars: 'vertical' // Required for Material Bar Charts.
 };
 var chart = new google.charts.Bar(document.getElementById('barchart_material'));
 chart.draw(data, google.charts.Bar.convertOptions(options));

in data_res.data I am getting json resonse like,
"message": [
    [
      "Months",
      "2016-2017",
      "2017-2018",
      "2018-2019",
      "2019-2020"
    ],
    [
      "August",
      33,
      159,
      161,
      87
    ],
    [
      "September",
      46,
      179,
      154,
      105
    ],
    [
      "October",
      45,
      199,
      147,
      116
    ],
    [
      "November",
      49,
      188,
      143,
      117
    ],
    [
      "December",
      45,
      187,
      139,
      114
    ],
    [
      "January",
      59,
      186,
      134,
      116
    ],
    [
      "February",
      87,
      183,
      135,
      110
    ],
    [
      "March",
      104,
      170,
      132,
      0
    ],
    [
      "April",
      99,
      167,
      126,
      0
    ],
    [
      "May",
      86,
      164,
      108,
      0
    ],
    [
      "June",
      11,
      9,
      4,
      0
    ],
    [
      "July",
      4,
      8,
      2,
      0
    ]
  ]

Please check and give me any solution

Daniel LaLiberte

unread,
Feb 24, 2020, 10:47:09 AM2/24/20
to Google Visualization API
If this situation is like the other one(s), you are probably loading the loader (www.gstatic.com/charts/loader.js) more than one time.  So remove the extra ones and it should work fine.  Otherwise, please post a link to a page that demonstrates the problem so we can see it in action.  Also, specify your browser and version of the browser.

--
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-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/2113de5f-ff81-442a-b88b-e643d5a15d50%40googlegroups.com.


--

Tushar Patel

unread,
Feb 25, 2020, 1:24:56 AM2/25/20
to google-visua...@googlegroups.com
Thank you very much for the help.
Yes there was two times I loaded that file and it cause issue.
again thank you very much for fast reply.

Reply all
Reply to author
Forward
0 new messages