1) My requirement is that Plotarea of chartview in Qml should acquire whole space. 2) I don't want spacing between chartview and plotarea grids. 3) For this, i made
margins.top: 0
margins.bottom: 0
margins.left: 0
margins.right: 0
4) After Doing this, there was still little spacing between grids and chartview. 5) Then i did this, by giving minus values to x,y axis and increasing width and height.
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) After doing this it got adjusted properly. 7) But when i am chaning Valueaxis(max), then it is again chaing it's position. 8) Valueaxis which is inside chartview, there is min max value, if max=5 then it's displaying properly, if i change max=10 then it's changing its position, on some value's it's showing properly, on some it's not
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
}
Any Possible Solution ?
Here's how to do that:
You're forcing your
plotArea
to be at the same position of theChartView
and to have same dimensions. It might probably beQt.rect(0, 0, width, height)
. I haven't tried it with your numbers. I'm assuming it's 0, 0 because that's the offset from theparent
ChartView
.