JSFiddle - React, Tailwind, and code Playground
by stackflow234
HTML
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.light.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://jqwidgets.com/public/jqwidgets/jqxcore.js"></script>
<script src="https://jqwidgets.com/public/jqwidgets/jqxdata.js"></script>
<script src="https://jqwidgets.com/public/jqwidgets/jqxdraw.js"></script>
<script src="https://jqwidgets.com/public/jqwidgets/jqxchart.core.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Graphical View</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<div class="col-12 header">
<div style="text-align:left; vertical-align:text-top;color:#fff; font-size:18px;">
<div class="col-6" style="float:left;">
<h1>Graphical reports</h1>
</div>
</div>
</div>
<div style="height:auto">
<div class="col-12 headerBg">
Daily Volume(ML)
</div>
<div id='chartContainer' style="width:100%; height:500px;">
</div>
<div class="col-12 headerBg">
Daily kWh/ML
</div>
<div id="chartContainer1" style="width:100%; height:500px;">
</div>
</div>
</body>
</html>
JavaScript
$(document).ready(function () {
var data = [{"Value":"0.458","Label":"06-19-19"},{"Value":"0.895","Label":"06-20-19"},{"Value":"0.569","Label":"06-21-19"},{"Value":"0.5565","Label":"06-22-19"},{"Value":"0.5687","Label":"06-23-19"},{"Value":"0.14587","Label":"06-24-19"},{"Value":"0.1254","Label":"06-25-19"}];
var source = {
datatype: 'json',
localdata: data,
datafields: [
{
name: 'Date',
name: 'Volume'
}
]
};
var settingsColumn = {
title: { visible: false },
description: { visible: false },
showLegend: true,
enableAnimations: true,
borderLineColor: 'transparent',
padding: { left: 5, top: 5, right: 5, bottom: 5 },
titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
source: data,
xAxis:
{
dataField: 'Label',
gridLines: { visible: false },
valuesOnTicks: false,
type: 'date',
baseUnit: 'day',
formatFunction: function (dateValue) {
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
//console.log(dateValue + '|' + months[dateValue.getMonth()]);
console.log(dateValue);
// alert(dateValue.getYear());
var fdate = dateValue.getDate() + '-' + months[dateValue.getMonth()] + '-' + dateValue.getFullYear().toString().substr(-2);
return fdate;
},
},
colorScheme: 'scheme01',
columnSeriesOverlap: false,
seriesGroups:
...