Skip to content

Commit

Permalink
fix(BarChart): prevent bar chart from trying to request raw data by d…
Browse files Browse the repository at this point in the history
…efault
  • Loading branch information
diehbria committed Mar 23, 2023
1 parent 2f5e776 commit 6845d95
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { useViewport } from '../../hooks/useViewport';
import { DEFAULT_VIEWPORT } from '../../common/constants';
import { LegendConfig } from '@synchro-charts/core';

const HOUR_IN_MS = 1000 * 60 * 60;
const DAY_IN_MS = HOUR_IN_MS * 24;

export const BarChart = ({
queries,
thresholds = [],
Expand All @@ -31,6 +34,12 @@ export const BarChart = ({
settings: {
fetchFromStartToEnd: true,
fetchMostRecentBeforeStart: true,
/** Bar chart cannot visualize raw data, so customize the resolution breakpoints as the default resolution */
resolution: {
[0]: '1m',
[HOUR_IN_MS]: '1hr',
[DAY_IN_MS * 5]: '1day',
},
},
styles,
});
Expand Down

0 comments on commit 6845d95

Please sign in to comment.