UNPKG

@devops-web/cs-chart

Version:

## 更新流程 1. 切换源到npm官方源https://registry.npmjs.org/ 2. npm login 3. npm run lib 4. 修改package.json中的版本号 5. npm publish --access public

54 lines (53 loc) 1.12 kB
// 条形图,横向柱状图的变形 export default { type: 'hbar', name: '条形图', option: (data) => ({ tooltip: false, legend: false, grid: { top: '5%', left: '3%', right: '4%', bottom: '3%', containLabel: true, }, xAxis: { show: false, type: 'value', }, yAxis: { axisTick: false, axisLabel: false, type: 'category', inverse: true, data: data.x, }, series: data.y.map((item) => ({ type: 'bar', barCategoryGap: 40, barWidth: '45%', label: { show: true, position: [10, -16], formatter: (obj) => { const value = data.valueFormater ? data.valueFormater(obj.value) : obj.value; return `{value|${value}} {title|${data.x[obj.dataIndex]}}`; }, rich: { title: { color: '#666', }, value: { fontWeight: 'bold', padding: [1, 2, 2, 2], }, }, }, emphasis: { focus: 'series' }, ...item, })), }), };