Skip to content

Latest commit

 

History

History
77 lines (62 loc) · 2.4 KB

bc-chart-candlestick.md

File metadata and controls

77 lines (62 loc) · 2.4 KB

bc-chart-candlestick

Candlestick/OHLC chart (ECharts)

Quick Start

<bc-chart-candlestick data='{"categories":["Mon","Tue","Wed"],"data":[[20,34,10,38],[40,35,30,50],[31,38,33,44]]}' />

Props

Prop Type Default Description
data string (JSON) '[]' Chart data — {categories, data}
chart-title string '' Chart title
colors string (JSON) '' Color palette ["#4f46e5","#06b6d4"]
legend boolean true Show legend
tooltip-enabled boolean true Show tooltip
animate boolean true Enable animation
height string '300px' Chart height
width string '100%' Chart width
loading boolean false Show loading overlay
data-source string '' Remote data URL
fetch-headers string '' Custom fetch headers (JSON)
refresh-interval number 0 Auto-refresh interval (ms)
theme string '' ECharts theme ('dark' or custom JSON)
renderer string 'canvas' Renderer ('canvas' or 'svg')
toolbox boolean false Show toolbox (save, zoom, restore)
data-zoom boolean false Show data zoom slider
locale string '' ECharts locale

Type-Specific Props

Prop Type Default Description
show-ma boolean false Show moving average line
ma-period number 5 Moving average period

Data Format

{
  "categories": ["2024-01-01","2024-01-02","2024-01-03","2024-01-04"],
  "data": [
    [20, 34, 10, 38],
    [40, 35, 30, 50],
    [31, 38, 33, 44],
    [38, 15, 5, 42]
  ]
}

Each data item is [open, close, low, high].

Events

Event Payload
lcChartClick {name, value, dataIndex}
lcChartHover {name, value, dataIndex}
lcChartLegendSelect {name, selected}
lcChartDataZoom {start, end}
lcChartReady void

Methods

Method Returns Description
updateData(data) Promise Update chart data
setData(data) Promise Alias for updateData
refresh() Promise Re-fetch or re-render
resize() Promise Resize chart
exportImage(format?) Promise Export as image (png/jpeg/svg)
getChartInstance() Promise Get raw ECharts instance

See theming, data-fetching.