JSFiddle - React, Tailwind, and code Playground

by Sanket Bhalerao

HTML

<script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<div id="alertSummeryChart" style="height:500px; width:500px"> 

</div>

CSS

.tolerenceDown{
  width:30px;
  height:30px;
  background-color:black;
}

JavaScript

$(function () {$('#alertSummeryChart').highcharts({
chart: {
                 
            zoomType: 'xy'
        },
        title: {
            text: 'Average Monthly Temperature and Rainfall in Tokyo'
        },
        subtitle: {
            text: 'Source: WorldClimate.com'
        },
        xAxis: [{
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
                'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
            crosshair: true
        }],
        tooltip: {
            shared: true
        },
        legend: {
            layout: 'vertical',
            align: 'left',
            x: 120,
            verticalAlign: 'top',
            y: 100,
            floating: true,
            backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
        },
            
        series: [{
            name: 'actual',
            type: 'column',
            data: [200, 715, 604, 292, 244, 176.0, 135.6, 485, 216.4, 541, 95.6, 54.4],
        }, {
            name: 'average',
            type: 'spline',
            data: [700, 690, 195, 145, 182, 215, 252, 265, 233, 183, 139, 96],
            
        }],
            plotOptions: {
            column: {
                dataLabels: {
                    enabled: true,
                    useHTML: true,
                    shared:true,
                    formatter: function(args) {
        //trying to put condition here for the upward and downward arrow.                                 
        return '<div ><div class="tolerenceDown" ></div></div>'; 
                        
                        
                    },
                   
                }
            }
        }
            
	    });});