JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="https://rawgithub.com/highslide-software/draggable-points/master/draggable-points.js"></script>
<div id="volumeChart"></div>
<div id="drag"></div>
<div id="drop"></div>
JavaScript
var arrLabel = new Array();
var arrPromo = new Array();
var arrBase = new Array();
var arrFullPrice = new Array();
var arrUplift = new Array();
for (var i = 1; i <= 10; i++) {
arrLabel.push("Week" +i);
arrPromo.push(i*400);
arrBase.push(i*250);
arrFullPrice.push(i*200);
arrUplift.push(10);
}
var selectedchartType = 'column';
chartVolume = new Highcharts.Chart({
chart: {
renderTo: 'volumeChart',
height: 345,
animation: false,
type :selectedchartType,
zoomType: 'x',
marginRight: 50,
marginBottom: 65,
resetZoomButton: {
position: {
align: 'right',
verticalAlign: 'top'
}
},
},
xAxis: {
categories: arrLabel
},
yAxis:[ {
title: {
text: 'Volume'
},
},
{
title: {
text: 'Phasing'
},
opposite: true
}
],
plotOptions: {
series: {
point: {
events: {
/*
drag: function (e) {
// Returning false stops the drag and drops. Example:
// if (e.newY > 300) {
// this.y = 300;
// return false;
// }
$('#drag').html(
'Dragging <b>' + this.series.name + '</b>, <b>' +
this.category + '</b> to <b>' +
...