Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Touch in QML chartview
Forum Updated to NodeBB v4.3 + New Features

Touch in QML chartview

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 891 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.
  • R Offline
    R Offline
    Refi
    wrote on last edited by
    #1

    I have created a QML chart with code

         ChartView {
        id: chart
        anchors.fill: parent
        antialiasing: true
        ValueAxis {
            id: axisY
            tickCount: 3
        }
        DateTimeAxis{
               id: xTime
               gridVisible: false
           }
        ToolTip {
            id: id_toolTip
            contentItem: Text{
                color: "#21be2b"
            }
            background: Rectangle {
                    border.color: "#21be2b"
                }
    
        }
        SplineSeries{
            id: chartseries
            pointsVisible: true
            pointLabelsVisible: false
            useOpenGL: true
            axisX: xTime
            axisY: axisY
            onClicked: {
               id_toolTip.text = "dd"
                id_toolTip.visible = true;
             }
        }
    
    } 
    

    But tooltip is not showing on all touches . Sometimes it shows . Sometimes it did not. What will be the cause

    DiracsbracketD 1 Reply Last reply
    0
    • R Refi

      I have created a QML chart with code

           ChartView {
          id: chart
          anchors.fill: parent
          antialiasing: true
          ValueAxis {
              id: axisY
              tickCount: 3
          }
          DateTimeAxis{
                 id: xTime
                 gridVisible: false
             }
          ToolTip {
              id: id_toolTip
              contentItem: Text{
                  color: "#21be2b"
              }
              background: Rectangle {
                      border.color: "#21be2b"
                  }
      
          }
          SplineSeries{
              id: chartseries
              pointsVisible: true
              pointLabelsVisible: false
              useOpenGL: true
              axisX: xTime
              axisY: axisY
              onClicked: {
                 id_toolTip.text = "dd"
                  id_toolTip.visible = true;
               }
          }
      
      } 
      

      But tooltip is not showing on all touches . Sometimes it shows . Sometimes it did not. What will be the cause

      DiracsbracketD Offline
      DiracsbracketD Offline
      Diracsbracket
      wrote on last edited by Diracsbracket
      #2

      @Refi
      That is probably due to the hotspot of the touch not being exactly on the graph sometimes...

      One obvious way to improve this is to increase the width of your graph lines, but that may not be too pretty.

      Another way is to determine the closest point on your graph using some code computations.

      My idiot's solutions is this: superimpose the same series, make its color "transparent" but give it a sufficiently wide line thickness and put the click handler there...

      R 1 Reply Last reply
      1
      • DiracsbracketD Diracsbracket

        @Refi
        That is probably due to the hotspot of the touch not being exactly on the graph sometimes...

        One obvious way to improve this is to increase the width of your graph lines, but that may not be too pretty.

        Another way is to determine the closest point on your graph using some code computations.

        My idiot's solutions is this: superimpose the same series, make its color "transparent" but give it a sufficiently wide line thickness and put the click handler there...

        R Offline
        R Offline
        Refi
        wrote on last edited by Refi
        #3

        @Diracsbracket
        I think this is a good Idea . Will try this.
        Is there any to put tooltips only on graph points after making

        pointsVisible : true
        
        DiracsbracketD 1 Reply Last reply
        0
        • R Refi

          @Diracsbracket
          I think this is a good Idea . Will try this.
          Is there any to put tooltips only on graph points after making

          pointsVisible : true
          
          DiracsbracketD Offline
          DiracsbracketD Offline
          Diracsbracket
          wrote on last edited by
          #4

          @Refi
          In that case, I suggest making the transparent plot an XY scatter plot instead...

          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