ui: fix comparison for 24hr
This commit is contained in:
parent
3cb6c8824f
commit
3dd50df715
3 changed files with 1 additions and 14 deletions
|
|
@ -168,11 +168,9 @@ function WidgetChart(props: Props) {
|
|||
const loadComparisonData = () => {
|
||||
if (!dashboardStore.comparisonPeriods[_metric.metricId]) return setCompData(null);
|
||||
|
||||
const timestamps = dashboardStore.comparisonPeriods[_metric.metricId].toTimestamps();
|
||||
// TODO: remove after backend adds support for more view types
|
||||
const payload = {
|
||||
...params,
|
||||
...timestamps,
|
||||
..._metric.toJson(),
|
||||
viewType: 'lineChart',
|
||||
};
|
||||
|
|
|
|||
|
|
@ -37,13 +37,6 @@ function WidgetDateRange({
|
|||
|
||||
const onChangeComparison = (period: any) => {
|
||||
dashboardStore.setComparisonPeriod(period, metricStore.instance.metricId);
|
||||
if (!period) return;
|
||||
const periodTimestamps = period.toTimestamps();
|
||||
const compFilter = dashboardStore.cloneCompFilter();
|
||||
compFilter.merge({
|
||||
startTimestamp: periodTimestamps.startTimestamp,
|
||||
endTimestamp: periodTimestamps.endTimestamp,
|
||||
});
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -419,11 +419,7 @@ export default class DashboardStore {
|
|||
if (!period) {
|
||||
return this.comparisonPeriods[metricId] = null
|
||||
}
|
||||
this.comparisonPeriods[metricId] = Period({
|
||||
start: period.start,
|
||||
end: period.end,
|
||||
rangeName: period.rangeName,
|
||||
});
|
||||
this.comparisonPeriods[metricId] = period;
|
||||
}
|
||||
|
||||
cloneCompFilter() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue