Does anyone know how to use highcharts to render the same chart twice? My code that I have is:
$(function () {
$('#SuccessFailedRatio, #CounterfeitRatio').highcharts({
chart: {
....
I have two divs in my html with the id's shown above. Only one chart appears in CounterfeitRatio. Does anyone know how to make it appear in both divs? Thanks for the help!
Does anyone know how to use highcharts to render the same chart twice? My code that I have is:
$(function () {
$('#SuccessFailedRatio, #CounterfeitRatio').highcharts({
chart: {
....
I have two divs in my html with the id's shown above. Only one chart appears in CounterfeitRatio. Does anyone know how to make it appear in both divs? Thanks for the help!
Share Improve this question asked Aug 12, 2013 at 1:58 kchow23kchow23 471 silver badge6 bronze badges2 Answers
Reset to default 8I would separate your options into an object and then add that to two charts. Highcharts by default will only load your chart into the first element that fits your jQuery selector, so you have to add it to two elements specifically. Here is a jsFiddle!
var options = {
title: {
text: 'Monthly Average Temperature',
x: -20 //center
}
//etc...
};
$('#container').highcharts(options);
$('#container2').highcharts(options);
You can use this option:
$('#container').highcharts($.extend({},options));
$('#container2').highcharts($.extend({},options));
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744968143a4603808.html
评论列表(0条)