antvis/G2

版本4.1.20无法设置横轴颜色 #3530

hebingliang posted onGitHub

chart = new Chart({ container: 'container', autoFit: true, height: '50vh', padding: [40, 60, 40, 60], }); chart.data(this.listData); chart.axis('keyAsString', { label: { textStyle: { fill: '#ff0000', }, }, }); chart.scale('docCount', { range: [0, 1], type: 'linear', }); if (this.storeFilters.groupType == 4) { chart.scale('keyAsString', { formatter: k => this.$formatDate(new Date(k)), }); } else { chart.scale('keyAsString', {}); } chart.axis('keyAsString', { label: { textStyle: { fill: '#ff0000', }, }, }); chart.tooltip({ showCrosshairs: true, });

      chart.line().position('keyAsString*docCount');
      chart.area().position('keyAsString*docCount');
      chart.render();
      this.updateChart(chart);

如上代码所示:无法设置横轴颜色


Fund this Issue

$0.00
Funded

Pull requests