-
Notifications
You must be signed in to change notification settings - Fork 200
Closed
Description
Version
1.0.0
Link to Minimal Reproduction
none
Steps to Reproduce
const spec = {
type: 'pie',
categoryField: '20001',
valueField: '230718111907021',
data: [
{
id: 'data',
values: [
{
'20001': '消费者',
'230718111907021': 8025072,
'230718111907024': '消费者'
},
{
'20001': '公司',
'230718111907021': 5152793,
'230718111907024': '公司'
},
{
'20001': '小型企业',
'230718111907021': 2891088,
'230718111907024': '小型企业'
}
],
transform: [
{
type: 'fields',
options: {
fields: {
'20001': {
alias: '图例项 ',
domain: ['消费者', '公司', '小型企业']
},
'230718111907021': {
alias: '销售额'
},
'230718111907024': {
alias: '细分'
}
}
}
}
]
}
],
groupBy: '20001',
color: {
field: '20001',
type: 'ordinal',
range: ['#212121', '#656565', '#8ec8ac'],
specified: {
消费者: '#f5222d',
公司: '#7953CB',
小型企业: '#81c87c'
}
}
};
const vchart = new VChart(spec, { dom: document.getElementById('chart') as HTMLElement });
vchart.renderAsync();
// 只为了方便控制台调试用,不要拷贝
window['vchart'] = vchart;
setTimeout(() => {
vchart.updateSpec({
type: 'pie',
categoryField: '20001',
valueField: '230718111907021',
data: [
{
id: 'data',
values: [
{
'20001': '消费者',
'230718111907021': 1000000,
'230718111907024': '消费者'
},
{
'20001': '公司',
'230718111907021': 5152793,
'230718111907024': '公司'
},
{
'20001': '小型企业',
'230718111907021': 2891088,
'230718111907024': '小型企业'
}
],
transform: [
{
type: 'fields',
options: {
fields: {
'20001': {
alias: '图例项 ',
domain: ['消费者', '公司', '小型企业']
},
'230718111907021': {
alias: '销售额'
},
'230718111907024': {
alias: '细分'
}
}
}
}
]
}
],
groupBy: '20001',
color: {
field: '20001',
type: 'ordinal',
range: ['yellow', 'red', 'black'],
specified: {
消费者: '#f5222d',
公司: '#7953CB',
小型企业: '#81c87c'
}
}
});
}, 2000);
Current Behavior
the color does not work.
Expected Behavior
work
Environment
- OS:
- Browser:
- Framework:
Any additional comments?
No response