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. How to Remove Spacing between chartview and it's Plotarea.
Qt 6.11 is out! See what's new in the release blog

How to Remove Spacing between chartview and it's Plotarea.

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 1.0k Views 2 Watching
  • 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.
  • Bhushan_SureB Offline
    Bhushan_SureB Offline
    Bhushan_Sure
    wrote on last edited by
    #1
    1. My requirement is that Plotarea of chartview in Qml should acquire whole space.

    2. I don't want spacing between chartview and plotarea grids.

    3. For this, i made

      margins.top: 0
      margins.bottom: 0  
      margins.left: 0 
      margins.right: 0
      
    4. After Doing this, there was still little spacing between grids and chartview.

    5. Then i did this, by giving minus values to x,y axis and increasing width and height.

    Rectangle
    {
     width : 400
     height: 200
     clip:true
    
     ChartView
     {
      height: parent.height+42
      width: parent.width+51
      x:-32
      y:-15
      legend.visible:false
      margins.top: 0
      margins.bottom: 0
      margins.left: 0
      margins.right: 0
     }
    
    }
    
    1. After doing this it got adjusted properly.
    2. But when i am chaning Valueaxis(max), then it is again chaing it's position.
    3. Valueaxis which is inside chartview, there is min max value, if max=5 then it's displaying properly, if i change max=10 then it's changing its position, on some value's it's showing properly, on some it's not
    ValueAxis
        {
          id:y_axis
          min: 0
          max: 5 // on 5 it's proper, if i change it to 10 grids position is changing
          tickCount: 4
          labelsVisible: false
        }
    

    Any Possible Solution ?

    ODБOïO 1 Reply Last reply
    0
    • Bhushan_SureB Bhushan_Sure
      1. My requirement is that Plotarea of chartview in Qml should acquire whole space.

      2. I don't want spacing between chartview and plotarea grids.

      3. For this, i made

        margins.top: 0
        margins.bottom: 0  
        margins.left: 0 
        margins.right: 0
        
      4. After Doing this, there was still little spacing between grids and chartview.

      5. Then i did this, by giving minus values to x,y axis and increasing width and height.

      Rectangle
      {
       width : 400
       height: 200
       clip:true
      
       ChartView
       {
        height: parent.height+42
        width: parent.width+51
        x:-32
        y:-15
        legend.visible:false
        margins.top: 0
        margins.bottom: 0
        margins.left: 0
        margins.right: 0
       }
      
      }
      
      1. After doing this it got adjusted properly.
      2. But when i am chaning Valueaxis(max), then it is again chaing it's position.
      3. Valueaxis which is inside chartview, there is min max value, if max=5 then it's displaying properly, if i change max=10 then it's changing its position, on some value's it's showing properly, on some it's not
      ValueAxis
          {
            id:y_axis
            min: 0
            max: 5 // on 5 it's proper, if i change it to 10 grids position is changing
            tickCount: 4
            labelsVisible: false
          }
      

      Any Possible Solution ?

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      @Bhushan_Sure hi, is this the same question ?

      Bhushan_SureB 1 Reply Last reply
      0
      • ODБOïO ODБOï

        @Bhushan_Sure hi, is this the same question ?

        Bhushan_SureB Offline
        Bhushan_SureB Offline
        Bhushan_Sure
        wrote on last edited by
        #3

        @LeLev No it's some what different question, actually i found out what is the problem of previous and this question both, it's bug actually, it's changing position with respect to log10. Finding a way to ignore this bug, I will post solution if i get something.

        Bhushan_SureB 1 Reply Last reply
        0
        • Bhushan_SureB Bhushan_Sure

          @LeLev No it's some what different question, actually i found out what is the problem of previous and this question both, it's bug actually, it's changing position with respect to log10. Finding a way to ignore this bug, I will post solution if i get something.

          Bhushan_SureB Offline
          Bhushan_SureB Offline
          Bhushan_Sure
          wrote on last edited by
          #4

          Chartview's grid reposition itself everytime whenever min or max of Valueaxis changes. Whenever Valueaxis min or max changes in order of log10 then it reposition it's grid.

          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