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:
@@ -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);
|
||||||
|
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user