Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT Charts dragable
Qt 6.11 is out! See what's new in the release blog

QT Charts dragable

Scheduled Pinned Locked Moved Unsolved General and Desktop
chartsqml
1 Posts 1 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    ht1723
    wrote on last edited by
    #1

    Hi,
    I have a question regarding QT Qml and QT Charts.
    I want to create a interface, where the User can add Control Elements and choose a time where the Control should be activated.
    It should be possible to drag a point in the chart, for example from the Point 40/0 to the Point 50/0 (see code comments below), is there a way to do this with Qt Charts? In the Chart Example scatterinteractions i found a solution to mark scatter points, but i want also to be able to move the marked Points, and use the x values of the moved point to configure my time control.

    Thank you for your help!

    import QtQuick 2.7
    import QtQuick.Controls 2.0
    import QtQuick.Layouts 1.3
    import QtCharts 2.0
    
    ApplicationWindow {
        visible: true
        width: 640
        height: 480
        title: qsTr("Diagram")
        ChartView {
            title: "Diag"
            anchors.fill: parent
            antialiasing: true
    
            ValueAxis {
                id: valueAxis
                min: 0
                max: 60
                tickCount: 7
                labelFormat: "%.0f"
            }
            ValueAxis {
                id: axisY
                min: 0
                max: 1.5
                tickCount: 3
                labelFormat: "%.0f"
            }
    
            LineSeries {
                name: "signal 1"
                axisX: valueAxis
                axisY: axisY
                XYPoint { x: 0; y: 0 }
                XYPoint { x: 10; y: 0 }
                XYPoint { x: 10; y: 1 }
                XYPoint { x: 40; y: 1 } //drag this point to 50/1
                XYPoint { x: 40; y: 0 } //drag this point to 50/0
                XYPoint { x: 60; y: 0 }
            }
        }
    }
    
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved