antvis/G2

[v5] `style.fill` 设置不生效 #4667

visiky posted onGitHub

现象

<img width="400" alt="image" src="https://user-images.githubusercontent.com/15646325/220016982-9e6d2f1d-6d57-4633-953b-527b828fe01d.png">

复现代码

/**
 * A recreation of this demo: https://observablehq.com/@d3/bar-chart
 */
import { Chart } from '@antv/g2';

const chart = new Chart({
  container: 'container',
  autoFit: true,
});

chart.data({
  type: 'fetch',
  value:
    'https://gw.alipayobjects.com/os/bmw-prod/fb9db6b7-23a5-4c23-bbef-c54a55fee580.csv',
})

chart.interval().
  encode('x', 'letter')
  .encode('y', 1)
  .scale('y', { independent: true, range: [0, 1] })
  .axis('y', false)
  .style('fillOpacity',0.15)
  .style('fill', 'red')

chart
  .interval()
  .encode('x', 'letter')
  .encode('y', 'frequency')
  .axis('y', { labelFormatter: '.0%' });

chart.render();

这个和官网的 pattern 失效应该是同一个问题。

posted by pearmini about 2 years ago

Fund this Issue

$0.00
Funded

Pull requests