Commit 010f7d39 authored by Leo Iannacone's avatar Leo Iannacone

history: add total size using the chartist API

parent c1dd339f
...@@ -235,7 +235,12 @@ function Page_History() { ...@@ -235,7 +235,12 @@ function Page_History() {
} }
var options = { var options = {
seriesBarDistance: 12 seriesBarDistance: 12,
axisX: {
labelInterpolationFnc: function (value) {
return value + "<br /><span class='size'>" + total_sizes[value] + ' MB</span>';
}
}
}; };
Chartist.Bar('#disk-chart', { Chartist.Bar('#disk-chart', {
...@@ -243,21 +248,6 @@ function Page_History() { ...@@ -243,21 +248,6 @@ function Page_History() {
series: series series: series
}, options); }, options);
_create_graph_tooltip("#disk-chart", '.ct-bar', "MB"); _create_graph_tooltip("#disk-chart", '.ct-bar', "MB");
// WORKAROUND: add total spaces to label
// wating for support multilines for label in chartist-js
// https://github.com/gionkunz/chartist-js/issues/25
$('#disk-chart svg').height("+=20");
$('#disk-chart .ct-label.ct-horizontal').each(function (index, elem) {
var size = document.createElementNS("http://www.w3.org/2000/svg", 'text');
var currentY = Number(elem.getAttribute('dy'));
size.setAttribute('dx', Number(elem.getAttribute('dx')));
size.setAttribute('dy', currentY + 15);
size.setAttribute('class', 'ct-label ct-horizontal ct-size');
size.textContent = total_sizes[elem.textContent] + " MB";
elem.parentNode.appendChild(size);
});
} }
function _exportTableToCSV($table, filename) { function _exportTableToCSV($table, filename) {
......
...@@ -273,6 +273,11 @@ footer .info { ...@@ -273,6 +273,11 @@ footer .info {
font-size: 0.85em !important; font-size: 0.85em !important;
} }
#disk-chart .size {
color: #aaa;
font-size: 0.75em;
}
#distributions-chart.ct-chart { #distributions-chart.ct-chart {
height: 200px; height: 200px;
margin-top: -20px; margin-top: -20px;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment