Click here to Skip to main content
14,865,287 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a google line chart that should display data based on the values from a file. I need to handle the error if the syntax is not correct for drawing a chart.Please help.

What I have tried:

var chart = new google.charts.Line(document.getElementById('line_top_x'));
	  chart.draw(data, options);
Updated 22-Mar-17 0:28am

1 solution

User1454 22-Mar-17 6:37am
Yeah! I had given the same for the function, but it does not catch the syntax error !
Richard MacCutchan 22-Mar-17 7:06am
First you need to find out whether syntax errors actually throw an exception or return a status variable. Check the documentation to see which.
User1454 22-Mar-17 7:20am
Sorry i am new to this. But how can I display a message if the chart is not loaded ?
Richard MacCutchan 22-Mar-17 7:21am
Sorry, no idea. As I suggested above you need to study Google's documentation for the API in question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900