| | |
| | | fill: '#fff' |
| | | } |
| | | } |
| | | let label = plot.label |
| | | |
| | | if (Bar_axis.length) { |
| | | if (label === 'false') { |
| | | plot.customs.forEach(item => { |
| | | if (!Bar_axis.includes(item.type)) return |
| | | if (item.label === 'true') { |
| | | label = 'true' |
| | | } |
| | | }) |
| | | } else { |
| | | let reset = true |
| | | plot.customs.forEach(item => { |
| | | if (!Bar_axis.includes(item.type)) return |
| | | if (item.label === 'true') { |
| | | reset = false |
| | | } |
| | | }) |
| | | if (reset) { |
| | | label = 'false' |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (plot.label === 'top') { |
| | | lablecfg.offset = -5 |
| | |
| | | } else { |
| | | _chart.color('key') |
| | | } |
| | | if (plot.label !== 'false') { |
| | | if (label !== 'false') { |
| | | _chart.label('value*key', (value, key) => { |
| | | if (plot.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && colors.has(key)) { |
| | | if (label === 'true' && plot.labelColor === 'custom' && colors.has(key)) { |
| | | lablecfg.style.fill = colors.get(key) |
| | | } |
| | | return { |
| | |
| | | } else { |
| | | _chart.color('key') |
| | | } |
| | | if (plot.label !== 'false') { |
| | | if (label !== 'false') { |
| | | _chart.label('value*key', (value, key) => { |
| | | if (plot.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && colors.has(key)) { |
| | | if (label === 'true' && plot.labelColor === 'custom' && colors.has(key)) { |
| | | lablecfg.style.fill = colors.get(key) |
| | | } |
| | | |