Browse Source

add % in barchart

main
Christoph Marzell 2 months ago
parent
commit
9fdf52be97
  1. 16
      app/views/entries/index.html.erb

16
app/views/entries/index.html.erb

@ -66,8 +66,24 @@
<div class="tab-pane fade" id="chart" role="tabpanel"> <div class="tab-pane fade" id="chart" role="tabpanel">
<div class="container my-4 rounded border shadow-sm py-3 px-4"> <div class="container my-4 rounded border shadow-sm py-3 px-4">
<%= bar_chart @progress_chart_data, <%= bar_chart @progress_chart_data,
suffix: "%",
donut: false, donut: false,
height: "300px", height: "300px",
plugins: {
tooltip: {
callbacks: {
label: %|function(context) {
return context.dataset.label + ": " + context.raw + "%";
}|
}
},
legend: {
position: "bottom"
}
},
library: { library: {
legend: { position: "bottom" }, legend: { position: "bottom" },
tooltip: { tooltip: {

Loading…
Cancel
Save