Plot prices using plotly
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
<link rel="stylesheet" href="/static/classless.css">
|
||||
<link rel="stylesheet" href="/static/fioul.css">
|
||||
<link rel="icon" type="image/png" href="/static/favicon.png" />
|
||||
<script src="/static/plotly-2.12.1.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Prix du m³ de fioul pour Languidic</h1>
|
||||
@@ -16,5 +17,27 @@
|
||||
</tr>
|
||||
% end
|
||||
</table>
|
||||
<div id="price-plot"></div>
|
||||
<script>
|
||||
var plotDiv = document.getElementById('price-plot');
|
||||
var plotData = [{
|
||||
x: {{ [str(d.date) for d in results] }},
|
||||
y: {{ [d.price for d in results] }},
|
||||
type: 'scatter',
|
||||
}];
|
||||
var plotLayout = {
|
||||
margin: { t: 0 }
|
||||
};
|
||||
var plotConfig = {
|
||||
responsive: true,
|
||||
displaylogo: false,
|
||||
};
|
||||
Plotly.newPlot(
|
||||
plotDiv,
|
||||
plotData,
|
||||
plotLayout,
|
||||
plotConfig,
|
||||
);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user