Echarts
라인 차트(Line chart) ECharts 문서는 Apache ECharts 라이브러리 기반의 라인 차트 사용법을 다뤄요. 사용자 지정 테마, 스켈레톤, 반응형 컨테이너와 범례 배치 방법을 보여주는 베타 컴포넌트예요.
출처: 문서
본문
Info alert:Beta feature This beta component is currently under review and is still open for further evolution. It is available for use in product. Beta components are considered for promotion on a quarterly basis. Please join in and give us your feedback or submit any questions via Slack. To learn more about the process, visit our about page or our Beta components page on GitHub.
Introduction
Note: PatternFly React charts live in its own package at @patternfly/react-charts! 아래 예시들은 Apache ECharts 차트 라이브러리를 기반으로 하며, PatternFly를 위한 추가 기능, 사용자 지정 컴포넌트, 테마가 함께 포함되어 있어요. 이를 통해 일관된 마크업, 스타일, 동작으로 PatternFly 패턴을 만들 수 있는 React 기반 컴포넌트 모음을 제공해요.
Examples
Basic with right aligned legend
Green with responsive container and bottom aligned legend
Custom theme
이 예시는 여러 차트에 적용할 수 있는 사용자 지정 테마로 색상 스케일을 만드는 방법을 보여줘요.
Skeleton
Enable skeleton
Props
Charts
이 컴포넌트는 Apache ECharts 차트 라이브러리를 기반으로 해요. PatternFly를 위한 추가 기능, 사용자 지정 컴포넌트, 테마를 제공하며, 일관된 마크업, 스타일, 동작으로 PatternFly 패턴을 만들 수 있는 React 기반 컴포넌트 모음을 제공해요.
See https://echarts.apache.org/en/api.html#echarts
*required
| | Name | Type | Default | Description
| className
| string
|
| The className prop specifies a class name that will be applied to outermost element
|
| height
| number
|
| Specify height explicitly, in pixels
|
| id
| string
|
| The id prop specifies an ID that will be applied to outermost element.
|
| isLegendTooltip
| boolean
|
| Flag indicating to use the legend tooltip (default). This may be overridden by the option.tooltip property.
|
| isSvgRenderer
| boolean
|
| Flag indicating to use the SVG renderer (default). This may be overridden by the opts.renderer property.
|
| nodeSelector
| string
|
| This creates a Mutation Observer to watch the given DOM selector.
|
When the pf-v6-theme-dark selector is added or removed, this component will be notified to update its computed
theme styles. However, if the dark theme is not updated dynamically (e.g., via a toggle), there is no need to add
this Mutation Observer.
Note: Don't provide ".pf-v6-theme-dark" as the node selector as it won't exist in the page for light theme. The underlying querySelectorAll() function needs to find the element the dark theme selector will be added to.
| option | ChartsOptionProps | | ECharts uses this object to configure its properties; for example, series, title, and tooltip | See https://echarts.apache.org/en/option.html
| opts | EChartsInitOpts | | Optional chart configuration | See https://echarts.apache.org/en/api.html#echarts.init
| theme | any | | The theme prop specifies a theme to use for determining styles and layout properties for a component. Any styles or props defined in theme may be overwritten by props specified on the component instance. | See https://echarts.apache.org/handbook/en/concepts/style/#theme
| themeColor | string | | Specifies the theme color. Valid values are 'blue', 'green', 'multi', etc. | Note: Not compatible with theme prop
| width | number | | Specify width explicitly, in pixels |
ChartsOptionProps
See https://echarts.apache.org/en/option.html
*required | | Name | Type | Default | Description | angleAxis | AngleAxisOption | AngleAxisOption[] | | The angle axis in Polar Coordinate -- see https://echarts.apache.org/en/option.html#angleAxis | | animation | boolean | | Whether to enable animation -- see https://echarts.apache.org/en/option.html#animation | | animationDelay | number | | Delay before updating the first animation -- see https://echarts.apache.org/en/option.html#animationDelay | | animationDelayUpdate | number | | Delay before updating animation -- see https://echarts.apache.org/en/option.html#animationDelayUpdate | | animationDuration | number | | Duration of the first animation -- see https://echarts.apache.org/en/option.html#animationDuration | | animationDurationUpdate | number | | Time for animation to complete -- see https://echarts.apache.org/en/option.html#animationDurationUpdate | | animationEasing | string | | Easing method used for the first animation -- see https://echarts.apache.org/en/option.html#animationEasing | | animationEasingUpdate | string | | Easing method used for animation -- see https://echarts.apache.org/en/option.html#animationEasingUpdate | | animationThreshold | number | | Whether to set graphic number threshold to animation -- see https://echarts.apache.org/en/option.html#animationThreshold | | aria | AriaOption | | The W3C has developed the WAI-ARIA, the Accessible Rich Internet Applications Suite, which is dedicated to making web content and web applications accessible -- see https://echarts.apache.org/en/option.html#aria | | axisPointer | AxisPointerOption | AxisPointerOption[] | | This is the global configurations of axisPointer -- see https://echarts.apache.org/en/option.html#axisPointer | | backgroundColor | string | | Background color - see https://echarts.apache.org/en/option.html#backgroundColor | | blendMode | string | | Sets the type of compositing operation to apply when drawing a new shape -- see https://echarts.apache.org/en/option.html#blendMode | | brush | BrushOption | BrushOption[] | | Brush is an area-selecting component -- see https://echarts.apache.org/en/option.html#brush | | calendar | CalendarOption | CalendarOption[] | | Calendar coordinates -- see https://echarts.apache.org/en/option.html#calendar | | color | string[] | | The color list of palette -- see https://echarts.apache.org/en/option.html#color | | darkMode | boolean | 'auto' | | ECharts will automatically detect it via backgroundColor by default and adjust the text color accordingly - see https://echarts.apache.org/en/option.html#darkMode | | dataset | DatasetOption | DatasetOption[] | | Dataset brings convenience in data management separated with styles and enables data reuse by different series -- see https://echarts.apache.org/en/option.html#dataset | | dataZoom | DataZoomComponentOption | DataZoomComponentOption[] | | Data zoom component is used for zooming a specific area -- see https://echarts.apache.org/en/option.html#dataZoom | | geo | GeoOption | GeoOption[] | | ECharts will automatically detect it via backgroundColor by default and adjust the text color accordingly -- see https://echarts.apache.org/en/option.html#darkMode Geographic coordinate system component -- see https://echarts.apache.org/en/option.html#geo | | graphic | GraphicComponentLooseOption | GraphicComponentLooseOption[] | | Graphic component enables creating graphic elements in ECharts -- see https://echarts.apache.org/en/option.html#graphic | | grid | GridOption | GridOption[] | | Drawing grid in rectangular coordinate -- see https://echarts.apache.org/en/option.html#grid | | hoverLayerThreshold | number | | When the number of element of the whole chart is larger than hoverLayerThreshold, a separate hover layer is used to render hovered elements -- see https://echarts.apache.org/en/option.html#hoverLayerThreshold | | legend | LegendComponentOption | LegendComponentOption[] | | Legend component -- see https://echarts.apache.org/en/option.html#legend | | media | Object | | See Responsive Mobile-End for details -- see https://echarts.apache.org/en/option.html#media | | options | EChartsOption[] | | Option array used in timeline -- see https://echarts.apache.org/en/option.html#options | | parallel | ParallelCoordinateSystemOption | ParallelCoordinateSystemOption[] | | Parallel Coordinates is a common way of visualizing high-dimensional geometry and analyzing multivariate data -- see https://echarts.apache.org/en/option.html#parallel | | parallelAxis | Object | | This component is the coordinate axis for parallel coordinate -- see https://echarts.apache.org/en/option.html#parallelAxis | | polar | PolarOption | PolarOption[] | | Polar coordinate can be used in scatter and line chart -- see https://echarts.apache.org/en/option.html#polar | | radar | RadarOption | RadarOption[] | | Coordinate for radar charts -- see https://echarts.apache.org/en/option.html#radar | | radiusAxis | RadiusAxisOption | RadiusAxisOption[] | | Radial axis of polar coordinate -- see https://echarts.apache.org/en/option.html#radiusAxis | | series | Object | | Properties for various chart types -- see https://echarts.apache.org/en/option.html#series | | singleAxis | SingleAxisOption | SingleAxisOption[] | | An axis with a single dimension -- see https://echarts.apache.org/en/option.html#singleAxis | | stateAnimation | Object | | Animation configurations of state switchment -- see https://echarts.apache.org/en/option.html#stateAnimation | | timeline | TimelineOption | Object | | Timeline component -- see https://echarts.apache.org/en/option.html#timeline | | title | TitleOption | TitleOption[] | | Title component, including main title and subtitle -- see https://echarts.apache.org/en/option.html#title | | toolbox | ToolboxComponentOption | ToolboxComponentOption[] | | A group of utility tools -- see https://echarts.apache.org/en/option.html#toolbox | | tooltip | TooltipOptionProps | TooltipOptionProps[] | | Tooltip component -- see https://echarts.apache.org/en/option.html#tooltip | | useUTC | boolean | | Whether to use UTC in display -- see https://echarts.apache.org/en/option.html#useUTC | | visualMap | VisualMapComponentOption | VisualMapComponentOption[] | | Visual map is a type of component for visual encoding -- see https://echarts.apache.org/en/option.html#visualMap | | xAxis | XAXisOption | XAXisOption[] | | The x-axis in cartesian(rectangular) coordinate -- see https://echarts.apache.org/en/option.html#xAxis | | yAxis | YAXisOption | YAXisOption[] | | The y-axis in cartesian(rectangular) coordinate -- see https://echarts.apache.org/en/option.html#yAxis |
TooltipOptionProps
See https://echarts.apache.org/en/option.html#tooltip
*required | | Name | Type | Default | Description | alwaysShowContent | boolean | | Whether to show tooltip content all the time -- see https://echarts.apache.org/en/option.html#tooltip.alwaysShowContent | | appendTo | string | HTMLElement | Function | | Which DOM element to append the tooltip to -- see https://echarts.apache.org/en/option.html#tooltip.appendTo | | axisPointer | Object | | Configuration item for axisPointer -- see https://echarts.apache.org/en/option.html#tooltip.axisPointer | | backgroundColor | string | | The background color of tooltip's floating layer -- see https://echarts.apache.org/en/option.html#tooltip.backgroundColor | | borderColor | string | | The border color of tooltip's floating layer -- see https://echarts.apache.org/en/option.html#tooltip.borderColor | | borderWidth | number | | The border width of tooltip's floating layer -- see https://echarts.apache.org/en/option.html#tooltip.borderWidth | | className | string | | Specify the classes for the tooltip root DOM -- see https://echarts.apache.org/en/option.html#tooltip.className | | confine | boolean | | Whether confine tooltip content in the view rect of chart instance -- see https://echarts.apache.org/en/option.html#tooltip.confine | | destinationLabel | string | | The destination label shown in the tooltip -- for Sankey only | | enterable | boolean | | Whether mouse is allowed to enter the floating layer of tooltip -- see https://echarts.apache.org/en/option.html#tooltip.enterable | | extraCssText | string | | Extra CSS style for floating layer -- see https://echarts.apache.org/en/option.html#tooltip.extraCssText | | formatter | string | Function | | The content formatter of tooltip's floating layer -- see https://echarts.apache.org/en/option.html#tooltip.formatter | | hideDelay | number | | Delay time for hiding tooltip -- see https://echarts.apache.org/en/option.html#tooltip.hideDelay | | order | string | | Tooltip order for multiple series -- see https://echarts.apache.org/en/option.html#tooltip.order | | padding | number | | The floating layer of tooltip space around content -- see https://echarts.apache.org/en/option.html#tooltip.padding | | position | string[] | | The position of the tooltip's floating layer -- see https://echarts.apache.org/en/option.html#tooltip.position | | renderMode | string | | Render mode for tooltip -- see https://echarts.apache.org/en/option.html#tooltip.renderMode | | show | boolean | | Whether to show the tooltip component -- see https://echarts.apache.org/en/option.html#tooltip.show | | showContent | boolean | | Whether to show the tooltip floating layer -- see https://echarts.apache.org/en/option.html#tooltip.showContent | | showDelay | number | | Delay time for showing tooltip -- see https://echarts.apache.org/en/option.html#tooltip.showDelay | | sourceLabel | string | | The source label shown in the tooltip -- for Sankey only | | textStyle | Object | | The text style of tooltip's floating layer -- see https://echarts.apache.org/en/option.html#tooltip.textStyle | | transitionDuration | number | | The transition duration of tooltip's animation, in seconds -- see https://echarts.apache.org/en/option.html#tooltip.transitionDuration | | trigger | string | | Type of triggering -- see https://echarts.apache.org/en/option.html#tooltip.trigger | | triggerOn | 'mousemove' | 'click' | 'mousemove|click' | 'none' | | Conditions to trigger tooltip -- see https://echarts.apache.org/en/option.html#tooltip.triggerOn | | valueFormatter | string | | Callback function for formatting the value section in tooltip -- see https://echarts.apache.org/en/option.html#tooltip.valueFormatter |