Closed xile611 closed 9 months ago
1.3.0
no need
const theme = { colorScheme: { default: [ "#fff5f0", "#fee0d2", "#fcbba1", "#fc9272", "#fb6a4a", "#ef3b2c", "#cb181d", "#a50f15", "#67000d" ] }, series: { pie: { label: { position: 'inside' } } }, component: { discreteLegend: { visible: true, orient: 'top' } } }; const spec = { type: 'pie', theme, data: [ { id: 'id0', values: [ { type: 'oxygen', value: '46.60' }, { type: 'silicon', value: '27.72' }, { type: 'aluminum', value: '8.13' }, { type: 'iron', value: '5' }, { type: 'calcium', value: '3.63' }, { type: 'sodium', value: '2.83' }, { type: 'potassium', value: '2.59' }, { type: 'others', value: '3.5' } ] } ], outerRadius: 0.8, valueField: 'value', categoryField: 'type', title: { visible: true, text: 'Statistics of Surface Element Content' }, label: { visible: true }, // legends: { visible: true }, tooltip: { mark: { content: [ { key: datum => datum['type'], value: datum => datum['value'] + '%' } ] } } }; const vchart = new VChart(spec, { dom: CONTAINER_ID }); vchart.renderAsync(); // Just for the convenience of console debugging, DO NOT COPY! window['vchart'] = vchart;
the legend don't show
theme could open all the legends
- OS: - Browser: - Framework:
No response
符合预期,组件需要通过图表 spec 先实例化,然后才在组件的生命周期里将 theme merge 进 spec
Version
1.3.0
Link to Minimal Reproduction
no need
Steps to Reproduce
Current Behavior
the legend don't show
Expected Behavior
theme could open all the legends
Environment
Any additional comments?
No response