We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.13.2
null
const spec = { type: 'bar', data: [ { id: 'barData', values: [ { State: 'WY', Age: 'Under 5 Years', Population: 25635 }, { State: 'WY', Age: '5 to 13 Years', Population: 1890 }, { State: 'WY', Age: '14 to 17 Years', Population: 9314 }, { State: 'DC', Age: 'Under 5 Years', Population: 30352 }, { State: 'DC', Age: '5 to 13 Years', Population: 20439 }, { State: 'DC', Age: '14 to 17 Years', Population: 10225 }, { State: 'VT', Age: 'Under 5 Years', Population: 38253 }, { State: 'VT', Age: '5 to 13 Years', Population: 42538 }, { State: 'VT', Age: '14 to 17 Years', Population: 15757 }, { State: 'ND', Age: 'Under 5 Years', Population: 51896 }, { State: 'ND', Age: '5 to 13 Years', Population: 67358 }, { State: 'ND', Age: '14 to 17 Years', Population: 18794 }, { State: 'AK', Age: 'Under 5 Years', Population: 72083 }, { State: 'AK', Age: '5 to 13 Years', Population: 85640 }, { State: 'AK', Age: '14 to 17 Years', Population: 22153 } ] } ], xField: 'State', yField: 'Population', seriesField: 'Age', stack: true, legends: { visible: true, data: (items) => { console.log(items); return items.map((item, index) => ({ ...item, label: index })); } }, bar: { // The state style of bar state: { hover: { stroke: '#000', lineWidth: 1 } } } }; const vchart = new VChart(spec, { dom: CONTAINER_ID }); vchart.renderSync(); // Just for the convenience of console debugging, DO NOT COPY! window['vchart'] = vchart;
- OS: - Browser: - Framework:
No response
The text was updated successfully, but these errors were encountered:
@purpose233 这种用法修改了图例数据,交互后没有可用数据 如果只是想做图例项的格式化,应该通过 item.label.formatMethod 实现
item.label.formatMethod
https://visactor.com/vchart/option/barChart-legends-discrete#item.label.formatMethod
Sorry, something went wrong.
xile611
No branches or pull requests
Version
1.13.2
Link to Minimal Reproduction
null
Steps to Reproduce
Current Behavior
Expected Behavior
Environment
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: