JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://axibase.com/atsd/atsdClient.bundle.js"></script>
<script src="https://static.fusioncharts.com/code/latest/fusioncharts.js?cacheBust=434"></script>
<script src="https://static.fusioncharts.com/code/latest/fusioncharts.charts.js?cacheBust=434"></script>
<script src="https://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js?cacheBust=434"></script>
<div id="chart-container">FusionCharts will render here</div>
JavaScript
FusionCharts.ready(function() {
var startTime = Date.now() - 24 * 3600 * 1000,
endTime = Date.now();
var postData = [{
startTime: startTime,
endTime: endTime,
entity: "atsd",
metric: "jvm_memory_used",
tags: {
host: ["NURSWGVML007"]
},
aggregate: {
types: ["AVG"],
period: {
count: 1,
unit: "HOUR"
}
}
}];
var client = axibase.atsdClient("https://axibase.com");
client.series.queries(postData)
.then(function(response) {
var chart = new FusionCharts({
type: 'area2d',
renderAt: 'chart-container',
width: '900',
height: '600',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "ATSD jvm memory used",
"xAxisName": "Date",
"yAxisName": "Memory, Mb",
"paletteColors": "#0075c2",
"bgColor": "#ffffff",
"showBorder": "0",
"showCanvasBorder": "0",
"plotBorderAlpha": "10",
"usePlotGradientColor": "0",
"plotFillAlpha": "50",
"showXAxisLine": "1",
"axisLineAlpha": "25",
"divLineAlpha": "10",
"showValues": "0",
...