【问题标题】:HighCharts Pattern-fill Diagonal pattern with solid linesHighCharts Pattern-fill 实线对角线图案
【发布时间】:2019-03-11 16:56:46
【问题描述】:

我正在尝试完成一个对角线图案,其中包含具有此 strokeWidth 值的实线。到目前为止,这是我想出的,但我似乎无法获得正确的 d-path:

Highcharts.chart('container', {
  chart: {
    type: 'area'
  },

  title: {
    text: 'Pattern fill plugin demo'
  },

  xAxis: {
    categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  },

  plotOptions: {
    area: {
      fillColor: {
        pattern: {
          path: {
            d: 'M 0 0 L 25 25 M 24 -1 L 26 1 M -1 24 L 1 26',
            strokeWidth: 9
          },
          width: 25,
          height: 25,
          opacity: 0.2
        }
      }
    }
  },

  series: [{
    data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6],
    color: '#88e',
    fillColor: {
      pattern: {
        color: '#11d'
      }
    }
  }, {
    data: [null, null, null, null, null, 43.1, 95.6, 148.5, 216.4, 194.1, 95.6, 54.4],
    color: '#e88',
    fillColor: {
      pattern: {
        color: '#d11'
      }
    }
  }]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/pattern-fill.js"></script>

<div id="container" style="height: 400px; max-width: 800px; margin: 0 auto"></div>

如果您看一下该示例,就会发现行中有中断。为了得到一条实心对角线,我需要改变什么?提前致谢!

【问题讨论】:

    标签: javascript css highcharts


    【解决方案1】:

    更新:我能够通过d: 'M 0 0 L 25 25 M -5 20 L 5 30 M 20 -5 L 30 5' 实现我想要的风格

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-19
      • 2012-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多