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 use labelsPrecision with chartView QML?
Forum Updated to NodeBB v4.3 + New Features

How to use labelsPrecision with chartView QML?

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

    Hi,

    I'm trying to remove decimals from my left Y axis.

    Do you know how to do?

            Rectangle{
                height: parent.height-fgaln.height
                width:parent.width
                anchors.bottom:parent.bottom
                anchors.left: parent.left
                color:"transparent"
                ChartView {
                    id:barChartView
                    anchors.fill:parent
                    legend.alignment: Qt.AlignBottom
    
                    antialiasing: true
                    backgroundColor:"transparent"
    
                    ValueAxis {
                        id: yAxis
                    }
                    BarSeries {
                        id: mySeries
                        axisX: BarCategoryAxis { categories: StringList.year()}
                        axisY: yAxis
                        labelsVisible :true
                        labelsPosition: AbstractBarSeries.LabelsOutsideEnd
    
                    }
                }
            }
    

    Thank you for you help

    1 Reply Last reply
    0
    • YunusY Offline
      YunusY Offline
      Yunus
      wrote on last edited by
      #2

      @filipdns Hi. I couldn't run your code but maybe you can try this in your valueaxis scope

      labelFormat: "%.0f"

      F 1 Reply Last reply
      3
      • YunusY Yunus

        @filipdns Hi. I couldn't run your code but maybe you can try this in your valueaxis scope

        labelFormat: "%.0f"

        F Offline
        F Offline
        filipdns
        wrote on last edited by
        #3

        @Yunus Hello, It's working fine thank you very much but could you explain little bit what "%.0f" is meaning ?

        King regards
        Philippe

        1 Reply Last reply
        0
        • YunusY Offline
          YunusY Offline
          Yunus
          wrote on last edited by
          #4

          @filipdns Hi again. it decides the number of digits after point

          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