antvis/G2




The issue has been closed
[Bug]: 自定义色板报错 #6612
HelloAny posted onGitHub
Describe the bug / 问题描述
按照官网文档里的方法自定义色板,控制台报错
代码:
import { Chart, register } from '@antv/g2';
register('palette.deepblues', () => {
return ['#9ed1f7', '#76bff3', '#57b3f0', '#39abee', '#07a1ec'];
});
....
const geoView = chart.geoView().coordinate({ type: 'mercator' });
geoView
.geoPath()
.data(data)
.encode('latitude', 'latitude')
.encode('longitude', 'longitude')
.scale('color', {
palette: 'deepblues',
})
Reproduction link / 复现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
No response
Version / 版本
🆕 5.x
OS / 操作系统
- macOS
- Windows
- Linux
- Others / 其他
Browser / 浏览器
- Chrome
- Edge
- Firefox
- Safari (Limited support / 有限支持)
- IE (Nonsupport / 不支持)
- Others / 其他