ECharts5 Option 枚举可选值汇总(只整理**有固定枚举**的配置项,数字/颜色/百分比这类自由值不列入)

0 阅读3分钟

说明:ECharts 配置极多,下面是开发高频枚举清单,按组件分类;boolean 统一只有 true/false,不再重复写;left/top/right/bottom 位置枚举统一:left / center / right(横向)、top / middle / bottom(纵向),也支持百分比、像素数字。

一、xAxis / yAxis 坐标轴

  1. typecategory 类目轴|value 数值轴|time 时间轴|log 对数轴
  2. axisPointer.type(坐标轴指示器) line 直线|shadow 阴影|cross 十字准星|none 无
  3. axisLabel.alignleft|right|center
  4. axisTick.alignWithLabel:true/false
  5. nameLocation(坐标轴名称位置) start|middle|end

二、tooltip 提示框

  1. triggeritem 图形触发(饼/散点)|axis 坐标轴触发(柱状/折线)|none 不触发
  2. triggerOnmousemove|click|mousemove|click|none
  3. axisPointer.type 和上面坐标轴一致:line/shadow/cross/none
  4. order(多系列提示排序) seriesAsc|seriesDesc|valueAsc|valueDesc

三、legend 图例

  1. orient 排布方向 horizontal 横向|vertical 纵向
  2. alignleft|right
  3. selectedModetrue单选|false关闭|'single'单选|'multiple'多选

四、visualMap 视觉映射(你前面问的 calculable 在这)

  1. typecontinuous 连续滑块|piecewise 分段离散
  2. orienthorizontal|vertical
  3. calculable:true/false 👉 开启拖拽手柄(仅 continuous 常用)
  4. hoverLink:true/false
  5. inRange/outOfRange 映射维度keycolor / symbolSize / opacity / colorAlpha / colorLightness / colorSaturation / colorHue

五、dataZoom 数据缩放

  1. typeslider 显示滑块|inside 内置(鼠标滚轮/拖拽,无UI)
  2. orienthorizontal|vertical
  3. zoomLock:true/false,锁定缩放,只能平移
  4. filterModefilter|weakFilter|empty|none

六、toolbox 工具箱

  • feature 内置可用key:saveAsImage / dataView / restore / dataZoom / magicType / brush
  • magicType.type(图表切换) line|bar|stack|tiled

七、series【最重要:type 全集】

bar        柱状图
line       折线图
pie        饼图
scatter    散点图
effectScatter 涟漪特效散点
candlestick K线图
radar      雷达图
heatmap    热力图
map        地图
lines      轨迹线图
graph      关系图
tree       树图
treemap    矩形树图
sunburst   旭日图
boxplot    箱线图
parallel   平行坐标
gauge      仪表盘
funnel     漏斗图
sankey     桑基图
themeRiver 主题河流图
pictorialBar 象形柱图
custom     自定义系列(renderItem)

series 公共子枚举

  1. symbol(点标记) circle 圆|rect 矩形|roundRect 圆角矩形|triangle 三角|diamond 菱形|pin 水滴|arrow 箭头|none 不显示
  2. label.position(标签位置,不同图略有差异,通用) top|bottom|left|right|inside|center > 饼图额外:outer|inner
  3. stack:字符串,相同字符串堆叠;null不堆叠
  4. sampling(折线降采样) lttb|average|max|min|sum
  5. areaStyle.origin(面积图起点) auto|start|end
  6. barLayout:horizontal|vertical(条形图)

饼图专属枚举

  • roseType:false / 'radius' / 'area'(南丁格尔玫瑰)

仪表盘 gauge

  • anchorPoint:auto / [x,y]
  • pointer.type:'auto'

八、brush 刷选组件

  1. brushModesingle|multiple
  2. brushTyperect 矩形|polygon 多边形|lineX横向|lineY纵向|circle圆形

九、timeline 时间轴

  1. orient:horizontal / vertical
  2. axisType:category / value / time

十、polar / radiusAxis / angleAxis 极坐标

  • radiusAxis / angleAxis 的 type:category / value / time / log
  • axisPointer 和 grid 坐标轴一致

十一、全局&动画相关

  1. animationEasing(缓动,高频) linear / cubicIn / cubicOut / cubicInOut / elasticOut / bounceOut
  2. stateAnimation.easing 同上
  3. blendMode(图形叠加,series.itemStyle) source-over|lighter|multiply|screen

十二、文本样式通用枚举(所有 textStyle / label)

  1. fontStylenormal|italic|oblique
  2. fontWeightnormal|bold|bolder|lighter|数字(100~900)
  3. align 水平对齐:left/center/right
  4. verticalAlign 垂直对齐:top/middle/bottom

十三、markPoint / markLine / markArea

  • symbol 和 series.symbol 一致
  • markLine.symbol 两端标记:数组 ['circle','arrow']