摘要
双轴图表中,柱状图无法立即显示,并且只有在调整页面大小(放大或缩小)后才开始显示
官方示例代码
在直接复制,替换为个人数据时,出现柱状图无法显示问题
const config = {
data: [data, data],
xField: 'time',
yField: ['value', 'count'],
geometryOptions: [
{
geometry: 'column',
},
{
geometry: 'line',
lineStyle: {
lineWidth: 2,
},
},
],
};
解决方法
仅需要将柱状图与折线图的配置信息位置互换即可
const dualAxesConfig = {
data: [overviewData, overviewData],
xField: 'typeName',
yField: ['points', 'commitNum'],
width: '100%',
yAxis: {
// 格式化左坐标轴
points: {
min: 0,
label: {
format