Graph 将0,0设置为c3图形中的原点(消除填充)
我正在使用c3生成一个图,我希望得到图的原点为0,0,没有任何填充。使用此代码,我的y轴在直线上(x轴),但在x轴上,0记号标记和y轴之间仍有间隙 我尝试了两种不同的方法,看起来两个轴的填充效果不同。在我的代码中是否有什么东西可以消除X和X左边的所有填充Graph 将0,0设置为c3图形中的原点(消除填充),graph,padding,c3.js,Graph,Padding,C3.js,我正在使用c3生成一个图,我希望得到图的原点为0,0,没有任何填充。使用此代码,我的y轴在直线上(x轴),但在x轴上,0记号标记和y轴之间仍有间隙 我尝试了两种不同的方法,看起来两个轴的填充效果不同。在我的代码中是否有什么东西可以消除X和X左边的所有填充 var chart = c3.generate({ padding: { top: 4, right: 150,
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
}
}
});
}
谢谢