Highcharts test tool
by vladiweb
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://github.highcharts.com/v3.0.2/modules/map.src.js"></script>
<div id="latencyHeatmap" style="height: 200px"></div>
<div id="iopsColumnChart" style="min-width: 310px; height: 60px; margin: 0 auto"></div>
<div id="throughputLineChart" style="min-width: 310px; height: 100px; margin: 0 auto"></div>
JavaScript
(function (Highcharts) {
var seriesTypes = Highcharts.seriesTypes,
each = Highcharts.each;
seriesTypes.heatmap = Highcharts.extendClass(seriesTypes.map, {
translate: function () {
var series = this,
options = series.options,
dataMin = Number.MAX_VALUE,
dataMax = Number.MIN_VALUE,
opacity,
minOpacity = options.minOpacity,
path,
color,
xAxis = series.xAxis,
yAxis = series.yAxis;
series.generatePoints();
each(series.data, function (point) {
/*
point.path = [
'M', point.col - 0.5, point.row - 0.5,
'L', point.col + 0.5, point.row - 0.5,
'L', point.col + 0.5, point.row + 0.5,
'L', point.col - 0.5, point.row + 0.5,
'Z'
];
point.shapeType = 'path';
point.shapeArgs = {
d: series.translatePath(point.path)
};
*/
point.shapeType = 'rect';
point.shapeArgs = {
x: Math.round(xAxis.translate(point.col - 0.5)),
y: Math.round(yAxis.translate(point.row - 0.5)),
width: 10,
height: 10
};
if (typeof point.y === 'number') {
if (point.y > dataMax) {
dataMax = point.y;
} else if (point.y < dataMin) {
dataMin = point.y;
}
}
});
series.translateColors(dataMin, dataMax);
},
getBox: function () {}
});
}(Highcharts));
Highcharts.setOptions({
...