score:27
if you go to Given Error Link
Highcharts Error #16
Highcharts already defined in the page
This error happens the second time Highcharts or Highstock is loaded in the same page, so the Highcharts namespace is already defined. Keep in mind that the Highcharts.Chart constructor and all features of Highcharts are included in Highstock, so if you are running Chart and StockChart in combination, you only need to load the highstock.js file.
Check whether you copied the scripts library for highcharts second time your code should contain only one time:
<script src="http://code.highcharts.com/highcharts.js"></script>
Edit
You are trying to show charts in same div as $('#container')
Here container is the Id for div. When both ascx render in a page it find the same div with Id container and render the chart which override one of it. so
Make two separate divs:
<div id="container1" style="min-width: 400px; height: 400px; margin: 0 auto"></div> <div id="container2" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
Remove script(following) from ascx and put it in MasterPage.:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>
For chart One:
$('#container1').highcharts({//other code
For chart Two:
$('#container2').highcharts({//other code
score:2
You can use this way to wrap the code which runs Highcharts.js library.:
if (!window.HighchartsUniqueName) {
window.HighchartsUniqueName = true;
// .. your code which runs Highcharts.js library here ...
}
I found it here https://stackoverflow.com/a/5154971 and it works for me.
In this way you don't need to put your script in the MasterPage if you don't want.
Be sure to use a very unique name, since it's a global variable.
Also keep in mind that the Highcharts.Chart constructor and all features of Highcharts are included in Highstock, so if you are running Chart and StockChart in combination, you only need to load the highstock.js file or you can wrap it in the same way.
Source: stackoverflow.com
Related Query
- Highcharts Error #16: charts not showing on the same page
- drilldown maps and funnell charts on the same page using highcharts
- How to export the whole page or html content with Highcharts not just the chart?
- Why are the labels for my opposite yaxis in Highcharts not showing up?
- DataLabels in Highcharts are outside the container / not showing
- c# WPF Webbrowser with Highchart, Javascript from external source not working "An error has occurred in the script on this page"
- how to display 2 same highcharts without duplicate the code
- Charts rendered using highcharts in angular2 do not take the height of the parent
- How to put two charts on the same page with different modules?
- Negative values in the data not showing in highcharts linechart
- Not able to render the charts in pdf using Wickedpdf and Highcharts in rails 2.3 app
- Highcharts how to align two charts yAxis on the same line
- Highcharts : I am changing x-axis label, why are the label's not showing up?
- Multiple "Script src" on same page causing sorting functions not to work on HighCharts
- Highcharts donut pie not showing hover indicator if the slice color is white
- Highcharts (Gauge) and Highstock on the same page with Meteor
- What's the code in Highcharts such that the bars (columns) in the same group use the same color?
- how to render multiple line charts - highcharts on same page using highcharts react wrapper - highcharts-react-offical
- "viewFullscreen" menu item is not showing in the context menu of highcharts 6.2.0
- web page is hanging while loading from DB and large data not showing on charts in asp.net mvc5
- Highcharts parsed drilldown not showing on page but does in console
- same js highcharts display not the same
- Highcharts charts on a page not rendering correctly when output to PDF using wkhtmltopdf
- Multiple charts with same data not loading in same page: Highcharts
- Conflict with GSAP and Highcharts on the same page
- Highcharts export button not showing (included the libraries etc)
- Highcharts - Exporting gantt charts not showing previous interaction by user
- Decimals on yAxis are not being displayed, even if that same code works on highcharts jsfiddle
- How to show multiple HighCharts charts in the same page?
- How to modify the code so that Highcharts graph does not cover fixed navigation bar at the top of the page?
More Query from same tag
- DataLabels formatter in Highchart for the first category
- How can I put text within horizontal bar chart data points using Highcharts as well as adding text underneath each data point? Example below:
- Highcharts Spiderweb after Gauge causes strange behavior
- How can I hide non-selected series and axes when using XY zoom with highcharts?
- HIghcharts Map from GeoJSON Data Showing Up Too Small
- setExtremes Event not working post setExtremes method call
- how to reset Highchart chart width in percentage on Button click
- Highcharts increase hover detection for markers
- hightchart Plotting variables Issue
- Title of highchart rendering bad
- Highcharts: Change Pie Colors By Clicking on a button
- How to get the DOM properties from event.target, so I can compare them?
- How do I create a draggable plot line in Highcharts?
- Highcharts - Column Chart: Compare corresponding values to change color
- reuse of same object of chart in highcharts to minimize coding
- How do you show grid lines for both x axis and y axis in highchart?
- Highcharts 8.0.4 is missing some x-axis labels
- Highstock navigator not adjustable
- HighStock - Custom chart type
- Highcharts waterfall chart shows unknown number in one series
- highcharts y axis value display left
- how to import JSON data into highstocks candlestick type graph?
- Highcharts - show markers on zoom event (selection) and hide on reset zoom. Is it possible?
- In Highcharts, are we able to make the border of a pyramid in 'dashed' style?
- Highchart guage needles showing below data labels
- How can i use double click in Highcharts and get that data
- How to import JSON data to Chart Array in web2py (Python)
- Highcharts charts on a page not rendering correctly when output to PDF using wkhtmltopdf
- Refresh highchart after hiding bar data
- How to make split grouped column bar chart in highcharts with percentage?