【发布时间】:2019-03-22 07:10:34
【问题描述】:
1)我的要求是Qml中chartview的Plotarea应该获得整个空间。 2) 我不希望图表视图和绘图区域网格之间有间距。 3)为此,我做了
margins.top: 0
margins.bottom: 0
margins.left: 0
margins.right: 0
4) 执行此操作后,网格和图表视图之间的间距仍然很小。 5) 然后我通过给 x,y 轴赋予负值并增加宽度和高度来做到这一点。
Rectangle
{
width : 400
height: 200
clip:true
ChartView
{
height: parent.height+42
width: parent.width+51
x:-32
y:-15
legend.visible:false
margins.top: 0
margins.bottom: 0
margins.left: 0
margins.right: 0
}
}
6) 这样做后,它得到了适当的调整。 7) 但是当我改变 Valueaxis(max) 时,它会再次链接它的位置。 8)图表视图内的Valueaxis,有最小最大值,如果max = 5那么它是 正确显示,如果我改变 max=10 那么它会改变它的位置,在某个值上 显示正常,有些则不显示
ValueAxis
{
id:y_axis
min: 0
max: 5 // on 5 it's proper, if i change it to 10 grids position is changing
tickCount: 4
labelsVisible: false
}
任何可能的解决方案?
【问题讨论】:
-
这能回答你的问题吗? How to remove spacing? QML ChartView
标签: qt qml qtquick2 qchart qchartview