我正在使用c3制作图表,我希望图形的原点为0,0而不需要任何填充。使用此代码,我的y轴就在直线上(x轴),但在x轴上,0刻度线和y轴之间仍然存在间隙。
我尝试了几个不同的东西,看起来两个轴的填充效果不同。我可以在我的代码中修复一些东西来摆脱X左边的所有填充吗?
var chart = c3.generate({
padding: {
top: 4,
right: 150,
bottom: 4,
left: 150,
},
data: {
x: 'x',
columns: [
['x', 0, intersect, intersect, xinterceptd/2, xinterceptd],
['demand curve', yinterceptd, (1*yinterceptd)+(1*demandslope*1*intersect), (1*yinterceptd)+(1*demandslope*1*intersect), yinterceptd/2 , 0],
['supply curve', yintercepts, supplyslope*intersect + (1*yintercepts), supplyslope*intersect + (1*yintercepts), (supplyslope*xinterceptd*1)/2 + (1*yintercepts), supplyslope*xinterceptd + (1*yintercepts)],
['equilibrum price', supplyslope*intersect + (1*yintercepts), supplyslope*intersect + (1*yintercepts), null, null, null],
['equilibrum quantity', null, 0, supplyslope*intersect + (1*yintercepts), null, null]
],
regions: {
'equilibrum price': [{'style':'dashed'}],
'equilibrum quantity': [{ 'style':'dashed'}]
}},
axis: {
x: {
label: xunits,
padding: {left: 0},
min: 0
},
y: {
label: yunits,
padding: {bottom: 0},
min: 0
}
}
});
}
由于