Skip to content

Latest commit

 

History

History
62 lines (48 loc) · 2 KB

File metadata and controls

62 lines (48 loc) · 2 KB
id Line chart
section components
subsection charts
propComponents
component source
Charts
ECharts-docs
component source
ChartsOptionProps
ECharts-docs
component source
TooltipOptionProps
ECharts-docs
beta true

import { FunctionComponent, useEffect, useRef, useState } from 'react'; import * as echarts from 'echarts'; import { LineChart } from 'echarts/charts'; import { GridComponent, TitleComponent, ToolboxComponent, TooltipComponent } from 'echarts/components'; import { SVGRenderer } from 'echarts/renderers'; import { getComputedStyleValue, getCustomTheme, Charts, ThemeColor } from '@patternfly/react-charts/echarts';

import chart_color_blue_300 from '@patternfly/react-tokens/dist/esm/chart_color_blue_300'; import chart_color_green_300 from '@patternfly/react-tokens/dist/esm/chart_color_green_300'; import chart_color_purple_300 from '@patternfly/react-tokens/dist/esm/chart_color_purple_300'; import chart_color_teal_300 from '@patternfly/react-tokens/dist/esm/chart_color_teal_300'; import chart_color_yellow_300 from '@patternfly/react-tokens/dist/esm/chart_color_yellow_300';

Introduction

Note: PatternFly React charts live in its own package at @patternfly/react-charts!

The examples below are based on the Apache ECharts chart library, along with additional functionality, custom components, and theming for PatternFly. This provides a collection of React based components you can use to build PatternFly patterns with consistent markup, styling, and behavior.

Examples

Basic with right aligned legend

Green with responsive container and bottom aligned legend

Custom theme

This demonstrates how to create a color scale via a custom theme, which may be applied to multiple charts.

Skeleton