score:2
OK, this error popped up again and that's because my comment above did not really solve it.
Here's the culprit: if you have a model that generates data for charts happen to return an empty array (say it's a new user and she hasn't added any data yet to the database), this empty array is passed to the controller -- which will then pass the empty array to the view with Highcharts.
When passing an empty array to my view containing Highcharts, Highcharts would run but would not find an element to inject the chart, because I also had a condition in the view that removed #container
if there was no data.
Without where to put the chart, Highcharts returns an innerHTML
error, that may or may not break your remaining javascript (my case).
The solution here had nothing to do with JS, but actually with putting a condition in my controller which would be in pseudo code:
if model that generates chart data returns empty array
don't generate view containing Highcharts
else
generate view containing Highcharts
Doing this not only I prevented the error for good but also reduced the overhead of running Highcharts when no data is present.
score:7
I had this problem. I had to surround the highChart creation code with document.ready
$(document).ready({
chart = new Highcharts.Chart({ //my cool chart
});
});
score:8
For me the problem was that I wasn't including jQuery before including HighCharts.
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-more.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
Threw the errors:
Uncaught TypeError: Cannot read property 'addEvent' of undefined(anonymous function) @ highcharts.js:313(anonymous function) @ highcharts.js:315(anonymous function) @ highcharts.js:331
Uncaught TypeError: n.getOptions is not a function(anonymous function) @ highcharts-more.js:8(anonymous function) @ highcharts-more.js:55
Uncaught TypeError: Cannot read property 'fireEvent' of undefined(anonymous function) @ exporting.js:9(anonymous function) @ exporting.js:24
But if I included jQuery first it didn't.
Source: stackoverflow.com
Related Query
- JavaScript error when using Highcharts
- Javascript Highcharts v3.0.5 - How to hide Y Axis Title when using multiple Y Axis
- Issues using highcharts node export server from ClojureScript - "0x03 error when performing chart generation"
- when printing page with highcharts using javascript this.print() width values in css in @media print seem to be ignored
- Javascript not working when using async attribute : Highcharts
- Error: Data source must be a URL for refresh | console error | javascript | Highcharts
- Highcharts javascript error when other javascript file is included
- Highcharts not referenced error when using setOptions
- Highcharts error #17 when adding series to the chart using angular 4
- Error when using Highcharts with Angular 2
- How do I dynamically change a data point in Highcharts using JavaScript
- Getting error while using highcharts in Angular 7
- php: laravel slow view render time when rendering javascript for highcharts
- Using Highcharts and displaying a message over or on the chart when there is no data
- highcharts organization chart is throwing error when loading module
- Update Chart Colors When Using Styled HighCharts Version
- Increase different marker sizes when hovering series using highcharts
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts tooltip date format when using pointFormat
- Angular JS - "Error: [$interpolate:interr] Can't interpolate:" when using Highcharts
- Query rails database, and update highcharts using Javascript
- Uncaught TypeError: undefined is not a function when using highcharts
- creating a bar chart using Highcharts with React - getting an error that rendering div isn't found
- Getting "Highcharts error #17" when creating histogram (using Highcharts with Angular 6)
- Multi-Line Title is not working when we export to PNG using CanVG - Highcharts
- HighCharts Stock Chart error code 18
- highcharts - error when updating a series to have less categories than previously
- c# WPF Webbrowser with Highchart, Javascript from external source not working "An error has occurred in the script on this page"
- How to remove outer shadow when hovered from highcharts JAVASCRIPT
- Why do I have the issue 'property assigment expected' when I want to display a chart on my web page using highcharts
More Query from same tag
- I tried to add colors to X-Axis labels without success
- The continuous update highcharts with more data plotting the continuity is not visible so we need that continuity in the centre of the graph
- Horizontal line on open and high of candlestick in stockchart
- highcharts dynamic categories not working
- running highcharts with flaskr and jinja2
- Using an input box to get a variable?
- Is it possible to define an image map area by radial coordinates?
- Animation origin of Highcharts library
- Highcharts Scatter, plotting 3 days data on 12AM to 12PM of one day x-axis
- Add time-stamp data from multiple csv files to highchart
- How to customize a legend in highcharts as the image and while clicking on the leg end appears lines inside linechart
- How to horizontally flip Highchart's chart?
- Column chart with categorised Y axis
- Highstock charts give "Uncaught TypeError: Cannot read property 'addPoint' of undefined" error
- Heroku and HighCharts Rails Gem -
- Highcharts not showing up
- Highcharts: Plot the errorbars behind the datapoints
- How do I remove the empty space beneath a solid gauge?
- Animation from point in Highcharts
- Importing data from HTML table to highcharts
- Highcharts combination chart from JSON data
- highchart bar data, borders fit to the data
- Call an angular component method when we click on highchart series
- Highcharts: Bar inside of a stacked bar
- Highcharts stock chart X axis date issue
- Create Default options for multiple highcharts
- Highchart - position x-axis label bottom to next label
- Angular HighCharts Update series
- highstocks intraday chart with timestamp and non decimal y axis
- Highcharts pie donut with gradient