highcharts 我们如何在甘特中的水平条中显示特定时间线的封锁区域

u3r8eeie  于 2022-11-11  发布在  Highcharts
关注(0)|答案(1)|浏览(205)

我在我的Angular 应用程序中使用甘特highcharts。在甘特图highcharts中,我需要在甘特图highcharts中的水平条中显示特定时间线的阻塞区域(条纹线)(以红色突出显示)。尝试了许多解决方案,但没有得到解决方案。请帮助。

r6l8ljro

r6l8ljro1#

示例如何将图案填充添加到渲染的背景中,记得加入到您的脚本中,脚本负责图案。<script src="https://code.highcharts.com/modules/pattern-fill.js"></script>

  1. chart.myBackground = chart.renderer.rect(plotLeft + 10, plotTop, firstPointWidth - 20, 50, 0)
  2. .attr({
  3. 'stroke-width': 1,
  4. stroke: 'red',
  5. fill: {
  6. pattern: {
  7. path: {
  8. d: 'M-1 1 l2 -2 M0 16 l16 -16 M15 17 l8 -8',
  9. strokeWidth: 2,
  10. zIndex: 6
  11. },
  12. color: 'black',
  13. width: 16,
  14. height: 16
  15. }
  16. },
  17. opacity: 0.5,
  18. zIndex: 5
  19. })
  20. .add();

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

展开查看全部

相关问题