Appearance
柱状图 API Reference
本页为完整参数参考,默认值以 BaseBar 实现为准。
BarSeriesOption
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| type | 系列类型 | 'bar' | - |
| data | 数据数组 | number[] | [] |
| name | 系列名称 | string | 未设置 |
| color | 柱颜色 | string | GradientColor | 未设置(继承主题) |
| barWidth | 柱宽 | number | 未设置 |
| barGap | 柱间距 | number | 未设置 |
| barCategoryGap | 类目间距 | number | 未设置 |
| stack | 堆叠名称 | string | 未设置 |
| label | 数据标签 | LabelOption | 未设置 |
| itemStyle | 柱样式 | ItemStyleOption | ItemStyleCallback | 未设置 |
| emphasis / blur / select | 状态样式 | SeriesStateOption | 未设置 |
| markPoint / markLine / markArea | 标注 | MarkPointOption / MarkLineOption / MarkAreaOption | 未设置 |
| gridIndex | 网格索引 | number | 未设置 |
| xAxisIndex | X 轴索引 | number | 未设置 |
| yAxisIndex | Y 轴索引 | number | 未设置 |
| datasetIndex | 数据集索引 | number | 未设置 |
| encode | 数据映射 | SeriesEncode | 未设置 |
| minHeight | 最小高度 | number | 未设置 |
| minHeightZero | 0 值最小高度 | boolean | true(BaseBar 默认) |
| borderRadius | 圆角 | number | 未设置 |
| borderSkipped | 跳过边 | string | string[] | 未设置 |
| roundCorner | 圆角模式 | number | 未设置 |
XAxisOption / YAxisOption(常用)
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| type | 轴类型 | 'category' | 'value' | 未设置 |
| data | 类目数据 | (string | number)[] | [] |
| includeZero | 是否包含 0 | boolean | 未设置 |
| boundaryGap | 类目间距 | boolean | 未设置 |
| axisLabel | 标签样式 | AxisLabelOption | 未设置 |
| axisLine | 轴线样式 | AxisLineOption | 未设置 |
| axisTick | 刻度样式 | AxisTickOption | 未设置 |
| splitLine | 分割线样式 | SplitLineOption | 未设置 |
| baseline | 基线 | BaselineOption | 未设置 |
GridOption / TooltipOption / LegendOption
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| grid | 网格布局 | GridOption | 未设置 |
| tooltip | 提示框 | TooltipOption | 未设置 |
| legend | 图例 | LegendOption | 未设置 |
DataZoomOption
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| dataZoom | 区间缩放 | DataZoomOption | DataZoomOption[] | 未设置 |