JSFiddle - React, Tailwind, and code Playground
by Alexandre Froger
HTML
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>
JavaScript
/*
* Prototype NGEHIGHCHARTS
* @dependencies media/com_nge/nge/ngetools.js - If ngetools is not loaded before, will return an error
* @dependencies media/com_nge/highcharts/v.X.X/highcharts.js
* @version: 1.1
*/
var NGEHIGHCHARTS = (function () {
/**** PUBLIC attribut ****/
//Loaded charts instances in the current document
this.charts = new Array();
this.shapes = new Array();
/**** PUBLIC method ****/
/**
* Draw an element in highchart
* @param Highcharts chart
* @param HighchartsRenderer labelGroup
* @param String stringValue
* @param String serieNumber
* @param String pointNumber
* @param String grapheType
* @param String isMobileHide
* @param String isRollover
* @param String moveHorizontal
* @param String moveVertical
* @return void
*/
NGEHIGHCHARTS.prototype.drawElement = function (chart, labelGroup, stringValue, serieNumber, pointNumber, grapheType, isMobileHide, isRollover, moveHorizontal, moveVertical) {
var point = chart.series[serieNumber].points[pointNumber];
isMobileHide = typeof isMobileHide !== 'undefined' ? isMobileHide : false;
isRollover = typeof isRollover !== 'undefined' ? isRollover : false;
moveVertical = typeof moveVertical !== 'undefined' ? Number(moveVertical) : 0;
moveHorizontal = typeof moveHorizontal !== 'undefined' ? Number(moveHorizontal) : 0;
var shape = null;
var anchorX = null;
var anchorY = null;
/*hide if isMobileHide is true and if we are on smartphone or tablette*/
if(!(isMobileHide && ngetools.isMobile())){
if(!isRollover){
shape = 'callout';
anchorX = point.plotX + chart.plotLeft;
anchorY = point.plotY + chart.plotTop - moveVertical;
}
var tmpElement = chart.renderer.label(
stringValue,
...