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. Want to hide label and want to show right Y axis in Chartview
Forum Updated to NodeBB v4.3 + New Features

Want to hide label and want to show right Y axis in Chartview

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 1.6k 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.
  • Bhushan_SureB Offline
    Bhushan_SureB Offline
    Bhushan_Sure
    wrote on last edited by
    #1

    Hi, I want to hide that "Green small box" above chartview, How can i do that ?
    also I tried Showing Right-Y-axis in code, But it's not reflecting in chartview, How can i reflect that ?

    0_1548314819980_Capture.PNG

    import QtQuick 2.9
    import QtQuick.Window 2.3
    import QtCharts 2.2
    
    Window
    {
        visible: true
        width: 700
        height: 300
        title: qsTr("Remove Label")
    
        ChartView {
            anchors.fill: parent
            antialiasing: true
            theme: ChartView.ChartThemeDark
    
            ValueAxis {
                id: x_axis
                min: 0
                max: 5
                tickCount: 6
            }
    
            ValueAxis
            {
                id:right_y_axis
                min:0
                max:30
                tickCount: 4
            }
    
            ValueAxis
            {
                id:left_y_axis
                min:0
                max:30
                tickCount: 4
            }
    
    
            LineSeries
            {
                id:l1
                axisYRight: right_y_axis
                axisX:x_axis
                axisY: left_y_axis
            }
        }
    }
    
    
    ODБOïO 1 Reply Last reply
    0
    • Bhushan_SureB Bhushan_Sure

      Hi, I want to hide that "Green small box" above chartview, How can i do that ?
      also I tried Showing Right-Y-axis in code, But it's not reflecting in chartview, How can i reflect that ?

      0_1548314819980_Capture.PNG

      import QtQuick 2.9
      import QtQuick.Window 2.3
      import QtCharts 2.2
      
      Window
      {
          visible: true
          width: 700
          height: 300
          title: qsTr("Remove Label")
      
          ChartView {
              anchors.fill: parent
              antialiasing: true
              theme: ChartView.ChartThemeDark
      
              ValueAxis {
                  id: x_axis
                  min: 0
                  max: 5
                  tickCount: 6
              }
      
              ValueAxis
              {
                  id:right_y_axis
                  min:0
                  max:30
                  tickCount: 4
              }
      
              ValueAxis
              {
                  id:left_y_axis
                  min:0
                  max:30
                  tickCount: 4
              }
      
      
              LineSeries
              {
                  id:l1
                  axisYRight: right_y_axis
                  axisX:x_axis
                  axisY: left_y_axis
              }
          }
      }
      
      
      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by ODБOï
      #2

      hi,
      @Bhushan_Sure said in Want to hide label and want to show right Y axis in Chartview:

      LineSeries
      {
      id:l1
      axisYRight: right_y_axis
      axisX:x_axis
      axisY: left_y_axis
      }

      doc says :

      Note: You can only provide either axisY or axisYRight, not both.

      The green box is the legend you can hide it, use QtCharts 2.3 instead of 2.2 and set legend.visible to false

      Bhushan_SureB 2 Replies Last reply
      2
      • ODБOïO ODБOï

        hi,
        @Bhushan_Sure said in Want to hide label and want to show right Y axis in Chartview:

        LineSeries
        {
        id:l1
        axisYRight: right_y_axis
        axisX:x_axis
        axisY: left_y_axis
        }

        doc says :

        Note: You can only provide either axisY or axisYRight, not both.

        The green box is the legend you can hide it, use QtCharts 2.3 instead of 2.2 and set legend.visible to false

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

        @LeLev Thank you so much, I will try and once this problem solved, i will close topic.

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

          hi,
          @Bhushan_Sure said in Want to hide label and want to show right Y axis in Chartview:

          LineSeries
          {
          id:l1
          axisYRight: right_y_axis
          axisX:x_axis
          axisY: left_y_axis
          }

          doc says :

          Note: You can only provide either axisY or axisYRight, not both.

          The green box is the legend you can hide it, use QtCharts 2.3 instead of 2.2 and set legend.visible to false

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

          @LeLev Both the issues got solved
          1) 1 solution

          For Green Rectangle, Property name "legend" is used, as legend property works
          only in Qt charts 2.3 and not in Qt charts 2.2
          

          2) 2 Solution

          For Right and left "y" axis, i used 2 lineseries, in one lineseries i sepcified 
          one axis, in another lineseries i specified other axis
          
          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