You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
2.0 KiB
66 lines
2.0 KiB
1 year ago
|
<html>
|
||
|
<head>
|
||
|
<title>Stacked Data Example | CurvedLines</title>
|
||
|
<style>
|
||
|
.chart-style {
|
||
|
width: 600px;
|
||
|
height: 260px;
|
||
|
}
|
||
|
</style>
|
||
|
|
||
|
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||
|
<script type="text/javascript" src="https://cdn.rawgit.com/flot/flot/v0.8.3/jquery.flot.js"></script>
|
||
|
<script type="text/javascript" src="https://rawgit.com/flot/flot/v0.8.3/jquery.flot.stack.js"></script>
|
||
|
<script type="text/javascript" src="https://rawgit.com/MichaelZinsmaier/CurvedLines/master/curvedLines.js"></script>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
$(function() {
|
||
|
//random data
|
||
|
var d1 = [];
|
||
|
for (var i = 0; i <= 10; i += 1) {
|
||
|
d1.push([i, parseInt(Math.random() * 30)]);
|
||
|
}
|
||
|
var d2 = [];
|
||
|
for (var i = 0; i <= 10; i += 1) {
|
||
|
d2.push([i, parseInt(Math.random() * 30)]);
|
||
|
}
|
||
|
var d3 = [];
|
||
|
for (var i = 0; i <= 10; i += 1) {
|
||
|
d3.push([i, parseInt(Math.random() * 30)]);
|
||
|
}
|
||
|
|
||
|
//flot options
|
||
|
var options = {
|
||
|
series: {
|
||
|
curvedLines: {
|
||
|
apply: true,
|
||
|
active: true,
|
||
|
monotonicFit: true
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
//plotting
|
||
|
$.plot($("#flotContainer"), [
|
||
|
{data: d1, lines: { show: true, fill: true }, stack: true },
|
||
|
{data: d2, lines: { show: true, fill: true }, stack: true },
|
||
|
{data: d3, lines: { show: true, fill: true }, stack: true }
|
||
|
], {});
|
||
|
|
||
|
$.plot($("#flotContainer2"), [
|
||
|
{data: d1, lines: { show: true, fill: true }, stack: true },
|
||
|
{data: d2, lines: { show: true, fill: true }, stack: true },
|
||
|
{data: d3, lines: { show: true, fill: true }, stack: true }
|
||
|
], options);
|
||
|
});
|
||
|
</script>
|
||
|
|
||
|
<h4>CurvedLines: random stacked data</h4>
|
||
|
<div id="flotContainer" class="chart-style"></div>
|
||
|
|
||
|
<h4>CurvedLines: same data connected with curved lines</h4>
|
||
|
<div id="flotContainer2" class="chart-style"></div>
|
||
|
<a href="index.html">Return to CurvedLines Examples list</a>
|
||
|
|
||
|
</body>
|
||
|
</html>
|