【问题标题】:Highcharts Display Xaxis plot lineHighcharts 显示 Xaxis 绘图线
【发布时间】:2021-03-19 09:42:00
【问题描述】:

如何在 DateTime 折线图上启用最左边的 Highcharts XAxis 绘图线。我想应该有一个默认选项来显示 XAxis 线而不需要知道最小值/起始值

我目前的进展 -> https://jsfiddle.net/Lpjb9wc7/

const chart = Highcharts.chart('container', {

credits: {
  enabled: false,
},
title: null,
xAxis: {
  title: 'Session',
  type: 'datetime',
  tickInterval: 3600 * 1000,
  gridLineWidth: 1
},
yAxis: {
  gridLineWidth: 0,
  title: {
    text: 'Temperature',
  },
},
legend: {
  enabled: false,
},
plotOptions: {
  series: {
    marker: {
      enabled: false,
    },
  },
},
series: [
  {
    data: [
      [1369206795000, 1],
      [1369225421000, 3],
      [1369230934000, 2],
    ],
  },
],

});

【问题讨论】:

    标签: javascript charts highcharts


    【解决方案1】:

    您需要更改lineWidth 属性的默认值。

        yAxis: {
            lineWidth: 1,
            ...
        }
    

    现场演示: https://jsfiddle.net/BlackLabel/49078gLx/

    API 参考: https://api.highcharts.com/highcharts/yAxis.lineWidth

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多