Skip to content

ChartLine 折线图 ​

类目轴上的折线。圆点是白底描边,默认略微平滑。和柱画在一起用 ChartCombo。

基础用法 ​

vue
<CkChartLine
  title="未到趋势"
  :categories="['07/19', '07/20', '07/21', '07/22', '07/23', '07/24']"
  :series="[{ name: '未到人数', data: [620, 530, 430, 760, 600, 920], color: '#F5A024' }]"
  :y-max="2000"
/>

多条折线 ​

vue
<CkChartLine
  title="到岗与未到"
  :categories="categories"
  :series="[
    { name: '实到人数', data: [1040, 1500, 1270, 1210, 1260, 1290] },
    { name: '未到人数', data: [620, 530, 430, 760, 600, 920], color: '#F5A024' },
  ]"
  :y-max="2000"
/>

面积 ​

area 在折线下方铺一层淡色。

vue
<CkChartLine
  :series="[{ name: '未到人数', data: [620, 530, 430, 760, 600, 920], area: true }]"
/>

API ​

属性说明类型默认
title左上角标题string—
categories横轴类目string[]内置日期
series折线系列ChartSeries[]未到人数
legend底部图例booleantrue
yMax纵轴最大值。刻度分成四段number—
option完整 ECharts option。只传 option 时按原样绘制object—

ChartSeries 在折线上还认 smooth 和 area。smooth 不传是 0.2,true 更圆,false 为折线。