antvis/G2

使用facetCircle绘制时,设置坐标轴label的颜色好像并不生效? #5623

voiddiddvue posted onGitHub

使用facetCircle绘制时,设置坐标轴label的颜色好像并不生效? 即在这个给定例子中,设置Jan、Feb的颜色并不生效

  import { Chart } from '@antv/g2';
  const M = [
    'Jan.',
    'Feb.',
    'Mar.',
    'Apr.',
    'May',
    'Jun.',
    'Jul.',
    'Aug.',
    'Sept.',
    'Oct.',
    'Nov.',
    'Dec.',
  ];
  const N = ['A', 'B', 'C', 'D'];
  const data = M.flatMap((month) =>
    N.map((name) => ({
      month,
      name,
      value: Math.random(),
    })),
  );

const chart = new Chart({
  container: 'container',
  width: 480,
  height: 480,
});

  const facetCircle = chart
    .facetCircle()
    .data(data)
    .encode('position', 'month')
    .axis('position', {  //这里设置,好像并没有生效?
      labelFill: 'red'
    })

facetCircle
.interval()
.encode('x', 'name')
.encode('y', 'value')
.encode('color', 'name')

chart.render();

另外我注意到当月份为奇数时,坐标轴刻度不能很好地和子图表对准,有没有什么好的解决方案呢 感谢!

G2 Version: 5.1.5


Fund this Issue

$0.00
Funded

Pull requests