1
0
mirror of https://github.com/flarum/core.git synced 2025-08-02 22:47:33 +02:00

Only show this period's value in tooltip

This commit is contained in:
Toby Zerner
2017-12-11 18:53:47 +10:30
parent b65ad8a5ce
commit 8860def12e
2 changed files with 8 additions and 5 deletions

View File

@@ -107,8 +107,8 @@ export default class StatisticsWidget extends DashboardWidget {
} }
const datasets = [ const datasets = [
{values: lastPeriod, title: 'Last period ➡'}, {values: lastPeriod},
{values: thisPeriod, title: 'This period'} {values: thisPeriod}
]; ];
if (!context.chart) { if (!context.chart) {
@@ -121,9 +121,7 @@ export default class StatisticsWidget extends DashboardWidget {
y_axis_mode: 'span', y_axis_mode: 'span',
is_series: 1, is_series: 1,
show_dots: 0, show_dots: 0,
colors: ['rgba(0,0,0,0.1)', app.forum.attribute('themePrimaryColor')], colors: ['rgba(0, 0, 0, 0.1)', app.forum.attribute('themePrimaryColor')]
format_tooltip_x: d => d,
format_tooltip_y: d => d
}); });
} else { } else {
context.chart.update_values(datasets, labels); context.chart.update_values(datasets, labels);

View File

@@ -63,4 +63,9 @@
clear: left; clear: left;
max-width: 600px; max-width: 600px;
margin: -20px -10px; margin: -20px -10px;
// Hide the "last period" data from the tooltip
.chart-container .graph-svg-tip ul.data-point-list > li:first-child {
display: none;
}
} }