UNPKG

@ansible/react-json-chart-builder

Version:

A chart builder component in react, which uses JSON for schema.

22 lines (21 loc) 1.18 kB
import { ChartLegend } from '@patternfly/react-charts/victory'; import React from 'react'; import { ChartData, ChartLegendEntry, ChartPie, ChartTopSchemaElement, PaddingProps } from '../types'; export type LegendComponentType = React.ReactElement<typeof ChartLegend>; export declare const getInteractiveLegendForMultiSeries: (element: ChartTopSchemaElement, chartData: ChartData, setData: (data: ChartData) => void) => LegendComponentType; export declare const getInteractiveLegendForSingleSeries: (element: ChartPie, serie: Record<string, string | number | boolean>[], setSerie: (serie: Record<string, string | number | boolean>[]) => void, chartData: ChartData) => LegendComponentType; interface LegendProps { padding?: { top: number; bottom: number; left: number; right: number; }; legendData?: ChartLegendEntry[]; legendPosition?: 'bottom' | 'right'; legendOrientation?: 'horizontal' | 'vertical'; legendComponent?: LegendComponentType; domainPadding?: number; } export declare const getLegendProps: (element: ChartTopSchemaElement, chartData: ChartData, originalPadding: PaddingProps) => LegendProps; export {};