How to hide/remove plotArea in QML Chartview
Solved
QML and Qt Quick
-
Hi Team,
I have a requirement to display only Y-axis without x-axis and plotArea.
So, I want to hide/remove plotArea in Qml chartview.
Can someone please suggest how to achieve below two points.- Hiding of PlotArea.
- Setting the width of the chart below 140 is messing up the Y-axis label.
I have implemented some sample code but not able to hide the plotarea.
Please find below my code
Window { id: root width: 640 height: 480 visible: true title: qsTr("Hello World") Item { width: 140 //Setting width below 140 is not adjusting the Y-axis labels properly height: 400 ChartView { id: chartView anchors.fill: parent legend.visible: false plotArea: Qt.rect(0,0,0,0) plotAreaColor: "yellow" ValueAxis { id: x_axis min: 0 max: 0 tickCount: 0 gridVisible: false labelsVisible: false lineVisible: false } ValueAxis { id:left_y_axis min:0 max:100 tickCount: 6 gridVisible: false } LineSeries { id:l1 axisY: left_y_axis axisX: x_axis } } } }
I am getting output like below
![alt text]( image url)The expected Output is like below
-
Hi @Praveen-Illa ,
To hide PlotArea you can define the color as "Transparent" -
-
@Praveen-Illa ,
I think it is not possible to do it. Maybe you can create a "custom" chart using canvas.
You can check this example: https://www.ics.com/blog/creating-qml-controls-scratch-linechart