dino-graph
Version:
a simple dynamic graphing library
61 lines (51 loc) • 1.06 kB
HTML
<html>
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
<script src="../dist/dino-graph.js"></script>
<title>bottom labels test</title>
</head>
<body>
<canvas id="canvas" width=600 height=300></canvas>
<script>
var data =
[
[
[ 0, 0 ],
[ 40, 50 ],
[ 60, 30 ],
[ 80, 10 ],
],
]
function dataFormat( data, opts )
{
return [ data[0], data[1] ]
}
var g = new DinoGraph
(
document.getElementById( 'canvas' ),
data,
{
frameRate: 60,
debug: true,
title: 'Y',
lineWidth: 8,
pointRadius: 5,
points: false,
lineStyle: 'round',
maxY: 60,
backgroundColour: 'rgba( 0, 0, 0, 0.05 )',
dataPadding: 5,
originLabel: false,
xOriginLabel: true,
valuePos: 'bottom',
paddingBottom: 40,
dataFormat: dataFormat,
valueSpacing: 50,
paddingRight: 0,
}
)
</script>
</body>
</html>