Fixed realtime chart for relational. Removed getDateArray. Added chart min/max dates.

This commit is contained in:
Mike Cao 2024-08-22 12:02:36 -07:00
parent 9311f0a183
commit 647dcb5f25
7 changed files with 46 additions and 46 deletions

View file

@ -12,6 +12,8 @@ export interface BarChartProps extends ChartProps {
renderYLabel?: (label: string, index: number, values: any[]) => string;
XAxisType?: string;
YAxisType?: string;
minDate?: number | string;
maxDate?: number | string;
}
export function BarChart(props: BarChartProps) {
@ -24,6 +26,8 @@ export function BarChart(props: BarChartProps) {
XAxisType = 'time',
YAxisType = 'linear',
stacked = false,
minDate,
maxDate,
} = props;
const options: any = useMemo(() => {
@ -32,6 +36,8 @@ export function BarChart(props: BarChartProps) {
x: {
type: XAxisType,
stacked: true,
min: minDate,
max: maxDate,
time: {
unit,
},