highcharts 如何让导航器只显示里程碑?

zf2sa74q  于 2022-11-10  发布在  Highcharts
关注(0)|答案(1)|浏览(224)

我有一个甘特与里程碑和药丸,在最后我有导航器显示所有任务(药丸和里程碑一样),我们想知道是否有办法限制导航器仅在栏中显示里程碑?在下图中,您可以看到实际的栏,我们确实看了文档,但找不到类似的东西,或者至少我们找不到它...谢谢你的帮助。x1c 0d1x

我错过了什么吗?谢谢你的帮助!

bvjxkvbb

bvjxkvbb1#

如果设置navigator.series选项(如pointPlacementpointPaddingpointWidth位于series.gantt中),则只会在导航器中显示里程碑。

navigator: {
    enabled: true,
    series: {
      type: 'gantt',
      pointPlacement: 0.5,
      pointPadding: 0.5,
    },
    yAxis: {
      min: 0,
      max: 4,
      reversed: true,
    }
  },
  series: [{
    name: 'Project 1',
    data: [{
      name: 'Create prototype',
      id: 'prototype',
      start: Date.UTC(2014, 10, 18),
      end: Date.UTC(2014, 10, 21)
    }, {
      name: 'Prototype done',
      dependency: 'prototype',
      start: Date.UTC(2014, 10, 21, 12),
      milestone: true,
      pointWidth: 10,
    }, {
      name: 'Develop',
      id: 'develop',
      start: Date.UTC(2014, 10, 20),
      end: Date.UTC(2014, 10, 25)
    }, {
      name: 'Development done',
      dependency: 'develop',
      start: Date.UTC(2014, 10, 25, 12),
      milestone: true,
      pointWidth: 10,
    }, {
      name: 'Test prototype',
      start: Date.UTC(2014, 10, 27),
      end: Date.UTC(2014, 10, 29)
    }, {
      name: 'Run acceptance tests',
      start: Date.UTC(2014, 10, 23),
      end: Date.UTC(2014, 10, 26)
    }]
  }]

演示:https://jsfiddle.net/BlackLabel/a94xkb0c/

相关问题