Home Forums Chart Support Clone Chart to Popup Modal on button click Reply To: Clone Chart to Popup Modal on button click

#14737

@daveb222,

It is not possible to clone the entire chart with events using clone method. Please refer this stackoverflow thread for more info. However you can try to render another chart on the modal with same chart options. Please take a look at the code snippet for creating multiple chart with same chart options.

var chartOptions = {
  title: {
    text: "Chart 1"
  },
  data: [{
    type: "spline",
    dataPoints: [
      { x: 10, y: 71 },
      { x: 20, y: 55 },
      { x: 30, y: 50 },
      { x: 40, y: 65 },
      { x: 50, y: 95 },
      { x: 60, y: 68 },
      { x: 70, y: 28 },
      { x: 80, y: 34 },
      { x: 90, y: 14 }
    ]
  }]
};

var chart1 = new CanvasJS.Chart("chartContainer1", chartOptions);
var chart2 = new CanvasJS.Chart("chartContainer2", chartOptions);

Also, check this JSFiddle for complete working code.

Clone chart in modal

___
Suyash Singh
Team CanvasJS