如何在 ApexCharts 中减小线图的线条粗细

3

我正在angular项目中使用Apex图表,我实现了一个时间序列图表,但是我无法减少线图中的“线条粗细”。

这是我的配置。

  public initChartData(): void {
  this.series =  this.response_data['data']
  this.chart = {
    type: "area",
    stacked: true,
    height: 350,
    zoom: {
      type: "x",
      enabled: true,
      autoScaleYaxis: false
    },

    toolbar: {
      autoSelected: "zoom",
      show: true,
      tools: {
      zoomin: false,
      zoomout: false,
    }
    },

  },

  this.dataLabels = {
    enabled: false
  };
  this.markers = {
    size: 0
  };
  this.stroke ={
    width: 1,
    curve: 'smooth',
  },

  this.fill = {
    type: "gradient",
    gradient: {
      shadeIntensity: 1,
      opacityFrom: 0.7,
      opacityTo: 0.9,
      stops: [0, 90, 100]
    },
    pattern: {
      strokeWidth: 0.5
    }
  };
  this.yaxis = {
    labels: {
      formatter: function(val) {
        return (val / 1).toFixed(0);
      }
    }
  };
  this.xaxis = {
    type: "datetime"
  };
  this.tooltip = {
    shared: false,
    y: {
      formatter: function(val) {
        return (val / 1).toFixed(0);
      }
    }
  };
}

有人能帮我解决这段代码吗?我已经尝试了其他方法,但都没有成功。

1个回答

5

您需要更改线条的描边以使其更加粗细。

尝试更改描边对象的宽度,以查看同一对象的变化。

this.stroke ={ width: 0.5, // 可使其变为现有或默认厚度的一半。 curve: 'smooth', }

更多信息请参考链接:https://apexcharts.com/docs/options/stroke/


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接