My chartview's right border is shifting towards left by some pixels after some time, don't know why, i tried everything !! I have attached Images to get the better idea, also i have added code, i have not done anything wrong, don't know why it is happening !!!
Rectangle
{
id: top
color: "black"
visible: true
width: 400
height: 250
focus: true
clip: true
//Variables and Array
property double x_axis_variable_for_wave_1:52
property double y_axis_variable_for_wave1
// ChartView 1
ChartView
{
id:chrt
height: parent.height
width: parent.width+51
x:-31
antialiasing: true
legend.visible: false
backgroundRoundness: 0
margins.top: 17
margins.bottom: 0
margins.left: 1
margins.right: 1
backgroundColor: "black"
ValueAxis
{
id:x_axis
min: 0
max: 50
tickCount: 5
labelsVisible: false
gridLineColor: "#969FB2"
color: "#969FB2"
}
ValueAxis
{
id:y_axis
min: 0
max: 5
tickCount: 4
labelsVisible: false
gridLineColor: "#969FB2"
color: "#969FB2"
}
LineSeries
{
id:l1
axisX: x_axis
axisY: y_axis
color: "yellow"
}
Timer
{
interval: 1000; repeat: true; running: true
onTriggered:
{
//Creating Random Y-axis variable for wave 1
y_axis_variable_for_wave1= Math.floor(Math.random()*(2-(6)+1)+(6));
//Increment X-axis for showing in reverse order wave
x_axis.min=x_axis.min+2
x_axis.max=x_axis.max+2
//Join Two points at Runtime
l1.append(x_axis_variable_for_wave_1,y_axis_variable_for_wave1)
//Increment variable for plotting on next x axis point
x_axis_variable_for_wave_1=x_axis_variable_for_wave_1+2
}
}
}
}
Below are the images which will show my doubt as you can see, there is gap in second image at right border as compare to first image. What is wrong ? can someone suggest ?