5.8. 设置图表展示选项

在图表组件HTML元素上定义dg-chart-options属性,即可设置此图表的展示选项。例如:

设置指定echarts图表不显示标题、图例顶部对齐、坐标系间隔顶部40像素:

  1. ...
  2. <div dg-chart-widget="..." dg-chart-options="{title:{show:false},legend:{top:0},grid:{top:40}}"></div>
  3. ...

设置指定标签卡图表不显示名称、或者标签值在前:

  1. ...
  2. <div dg-chart-widget="..." dg-chart-options="{showName:false}"></div>
  3. ...
  4. <div dg-chart-widget="..." dg-chart-options="{valueFirst:true}"></div>
  5. ...

在body元素上定义dg-chart-options属性,可设置全局图表展示选项。例如:

设置所有echarts图表的图例靠左显示:

  1. ...
  2. <body dg-chart-options="{legend:{left:0}}">
  3. ...