Open twtcc2351 opened 3 years ago
报错信息: Uncaught DOMException: Failed to execute 'ellipse' on 'CanvasRenderingContext2D': The major-axis radius provided (-0.808186) is negative.
const data = [ { type: '家具家电', sales: 38, }, { type: '粮油副食', sales: 52, }, { type: '生鲜水果', sales: 61, }, { type: '美容洗护', sales: 145, }, { type: '母婴用品', sales: 48, }, { type: '进口食品', sales: 38, }, { type: '食品饮料', sales: 38, }, { type: '家庭清洁', sales: 38, }, ];
const columnPlot = new Column('container', { data, xField: 'type', yField: 'sales', appendPadding:[16,100,16,16], label: { // 可手动配置 label 数据标签位置 position: 'middle', // 'top', 'bottom', 'middle', // 配置样式 style: { fill: '#FFFFFF', opacity: 0.6, }, }, columnStyle:{ radius:[10,10,10,10] }, xAxis: { label: { autoHide: true, autoRotate: false, }, }, meta: { type: { alias: '类别', }, sales: { alias: '销售额', }, }, });
columnPlot.render(); const el = document.getElementById('container'); el.style.width='5px'
顺便可以看下 polar 下的圆角支持 @pearmini
相关的 issue:https://github.com/antvis/G2Plot/issues/2510
相关 issue: #2399
报错信息: Uncaught DOMException: Failed to execute 'ellipse' on 'CanvasRenderingContext2D': The major-axis radius provided (-0.808186) is negative.
const data = [ { type: '家具家电', sales: 38, }, { type: '粮油副食', sales: 52, }, { type: '生鲜水果', sales: 61, }, { type: '美容洗护', sales: 145, }, { type: '母婴用品', sales: 48, }, { type: '进口食品', sales: 38, }, { type: '食品饮料', sales: 38, }, { type: '家庭清洁', sales: 38, }, ];
const columnPlot = new Column('container', { data, xField: 'type', yField: 'sales', appendPadding:[16,100,16,16], label: { // 可手动配置 label 数据标签位置 position: 'middle', // 'top', 'bottom', 'middle', // 配置样式 style: { fill: '#FFFFFF', opacity: 0.6, }, }, columnStyle:{ radius:[10,10,10,10] }, xAxis: { label: { autoHide: true, autoRotate: false, }, }, meta: { type: { alias: '类别', }, sales: { alias: '销售额', }, }, });
columnPlot.render(); const el = document.getElementById('container'); el.style.width='5px'
报错信息: Uncaught DOMException: Failed to execute 'ellipse' on 'CanvasRenderingContext2D': The major-axis radius provided (-0.808186) is negative.