generated from multiversx/mx-template-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chart png can be created regardless the amount of points, added new e…
…ndpoint that returns html document with the chart
- Loading branch information
1 parent
3def0cc
commit 37e1b0f
Showing
5 changed files
with
686 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>{{chartTitle}}</title> | ||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | ||
</head> | ||
|
||
<body> | ||
<h2>{{chartTitle}}</h2> | ||
<canvas id="myChart" width="800" height="300"></canvas> | ||
<script> | ||
const ctx = document.getElementById('myChart').getContext('2d'); | ||
const myChart = new Chart(ctx, { | ||
type: 'line', | ||
data: { | ||
labels: '{{labels}}', | ||
datasets: [{ | ||
label: 'volumeusd', | ||
data: '{{data}}', | ||
backgroundColor: 'rgba(75, 192, 192, 0.2)', | ||
borderColor: 'rgba(75, 192, 192, 1)', | ||
borderWidth: 1, | ||
fill: true, | ||
pointRadius: 0.5 | ||
}] | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
title: { | ||
display: true, | ||
text: '{{xTitle}}' | ||
} | ||
}, | ||
y: { | ||
beginAtZero: true, | ||
title: { | ||
display: true, | ||
text: '{{yTitle}}' | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.