【问题标题】:how to decrease line thickness of a line chart in apex charts如何减少顶点图表中折线图的线条粗细
【发布时间】:2021-01-21 12:18:48
【问题描述】:

我在角度项目中使用 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);
      }
    }
  };
}

谁能帮我处理这段代码,我也尝试了其他方法,但没有成功。

【问题讨论】:

    标签: javascript angular apexcharts


    【解决方案1】:

    您需要更改线条的笔触,使其更粗或更细。

    尝试更改笔触对象的宽度以查看相同的变化。

    this.stroke ={ width: 0.5, // 使其成为当前或默认厚度的一半。 曲线:'平滑', }

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-10
      • 2022-08-16
      • 1970-01-01
      • 2019-07-08
      • 2016-11-18
      • 1970-01-01
      • 2012-04-28
      • 2021-11-24
      相关资源
      最近更新 更多