How to draw a static graph like structure using canvas in QML?
Unsolved
General and Desktop
-
i am very new to Canvas side of QML so how can i get this kind of a structure using only Canvas in QML . just like the image .
i was only able to draw the line and add the horizontal lable, i need to know how to draw the vertical label and the arrows.
Canvas { id: chirp_canvas width: parent.width height: parent.height scale:1.05 onPaint: { var ctx = getContext("2d"); ctx.reset(); ctx.lineWidth=3; ctx.beginPath(); ctx.moveTo(10, 500) ctx.lineTo(10, 40); // how to add arrow ctx.fillText("Frequency",5,200) // how to make this a vertical text ctx.stroke(); ctx.beginPath(); ctx.moveTo(10,500); ctx.lineTo(600,500); //how to add arrow ctx.stroke(); } }
-
You will get better performance (and more help from Qt docs) if you use QQuickPaintedItem and draw this in C++.