高图反转折线图在最小值处部分隐藏 [英] Highcharts reversed line chart is partially hidden at min value

查看:45
本文介绍了高图反转折线图在最小值处部分隐藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用具有最小值和最大值的反向折线图时,该线会部分隐藏在最小值处.问题在于绘图画布恰好在最小值行处结束.当您的线较粗时,仅在其中可见一部分,位于最小值线上方的部分将被隐藏.您可以在此处看到示例.我尝试了其他方法来解决此问题,但还没有成功.有什么办法可以增加图表画布的顶部?

When using a reversed line chart with min and max values, the line is partially hidden at the min value. The problem is that the drawing canvas ends exactly at the min value line. When you have a line that is thick only part of it is visible there, the part that is lying above the min value line is hidden. You can see an example here. I tried different options to fix this but havent been successful. Is there a way you can increase the chart canvas on top?

这是高图代码:

$("#chart").highcharts({
  chart: {
  type: "line",
  spacingBottom: 30,
  height: 400,
  alignTicks: false,
  },
  credits: {
    enabled: false
  },
  legend: {
    enabled: false
  },
  title: {
    text: "Chart"
  },
  yAxis: [{
    title: null,
    reversed: true,
    showFirstLabel: true,
    allowDecimals: false,
    startOnTick: false,
    endOnTick: false,
    tickInterval: 5,
    minorTickInterval: 1,
    max: 10,
    min: 1,
  }],
  series: [{
    yAxis: 0,
    data: [6,2,2,1,1,1,1,1,1,1,1,1,1,2,2,1,1,2,2,2,2,2],
    lineWidth: 10, 
    marker: {
      enabled: false
    }
  }]
});

推荐答案

min:0.9 效果很好,除非您还设置了 tickPositions 而没有 startOnTick 设置.如果您要设置 tickPositions ,那么还要考虑向yAxis添加 startOnTick:false .

The min: 0.9 works well unless you have tickPositions set as well without startOnTick set. If you are setting tickPositions, then look at adding startOnTick: false to the yAxis as well.

这篇关于高图反转折线图在最小值处部分隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆