Options
All
  • Public
  • Public/Protected
  • All
Menu

React Json Chart Builder

Index

Type Aliases

ChartAxisFormatFunction: ((tick: string | number) => string)

Type declaration

    • (tick: string | number): string
    • The ChartAxisFormat function takes the tick data and should return the desired axis label to display. It can be used to format date or numbers.

      Parameters

      • tick: string | number

      Returns string

ChartDataComponentFunction: React.ElementType

The ChartDataComponentFunction should return a function that will render a specific component for points in the chart. Color of the component can be changes via props :{ style: { data: { fill: [your color] } } }

ChartLabelFormatFunction: ((data: { datum: Record<string, any> }) => string)

Type declaration

    • (data: { datum: Record<string, any> }): string
    • The ChartLabelFormatFunction takes the tick data where the datum contains the data point values. It should return the desired label to display in the chart.

      Parameters

      • data: { datum: Record<string, any> }

        The data point values. See VictoryCharts docs.

        • datum: Record<string, any>

      Returns string

ChartOnClickFunction: ((event: SyntheticEvent<any, Event>, props: Record<string, any>) => any)

Type declaration

    • (event: SyntheticEvent<any, Event>, props: Record<string, any>): any
    • The ChartOnClick function takes the events and the props passed to the function and can return anything. It can be used to redirect with the data point for example.

      Parameters

      • event: SyntheticEvent<any, Event>

        The event that was triggered, see SyntheticEvent.

      • props: Record<string, any>

        The props passed to the function from the data point. See VictoryCharts docs.

      Returns any

All the valid interfaces that can be part of the schema.

ChartSimpleProps: ChartBarProps | ChartLineProps | ChartAreaProps | ChartScatterProps

The ChartSimpleProps unifying all the possible types fot the simple chart props.

ChartStyleFunction: ((props: any) => any)

Type declaration

ChartTooltipComponentFunction: FunctionComponent<ChartTooltipProps>

The ChartTooltip should be a component, similar to the Patternfly ChartTooltip component which can be rendered in the chart when the user hover over a data point.

ChartTopSchemaElement: ChartWrapper | ChartPie

All the valid elements that can be top level elements in a chart.

Variables

ChartThemeColor: ChartThemeColorInterface

The color family to be applied to a theme. For example, 'blue' represents an ordered list of colors (i.e., a color scale) composed from the blue color family defined by PatternFly core.

For example, the 'blue' color scale looks like:

chart_color_blue_100 chart_color_blue_200 chart_color_blue_300 chart_color_blue_400 chart_color_blue_500

In this case, the chart_color_blue_100 value would be applied to the first data point in a chart. The chart_color_blue_200 value would be applied to the second data point in a chart. And so on...

If legend data is provided to a chart, those colors would be synced with the legend as well.

The 'multiOrdered' color family is intended for ordered charts; donut, pie, bar, & stack The 'multiUnordered' color family is intended for unordered charts; area & line The 'multi' defaults to the 'multiOrdered' color family

Note: These values are not intended to be applied directly as a component's fill style. For example, "multi" would not be a valid fill color. Please use chart variables from PatternFly core (e.g., via the react-charts package)

default: FunctionComponent<ChartInterface> = ...

The ChartRenderer component is the default export of the library.

The component is taking all the data, like schema and functions and renders the chart(s) with the data, using the Patternfly React Charts.

param props

See the ChartInterface type for more information

returns

The rendered chart component

functions: { axisFormat: Record<string, ChartAxisFormatFunction>; labelFormat: { default: ChartLabelFormatFunction; defaultStandalone: ChartLabelFormatFunction }; onClick: Record<string, ChartOnClickFunction>; tooltipComponent: Record<string, ChartTooltipComponentFunction> }

These default functions can be supplied to the charting library. They serve as a starting set of functions for basic usage. When editing the functions consider extending this set, since in places where in the schema the functions are not overwritten, the library will try to use the default names, which are defined here.

Type declaration

Generated using TypeDoc