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. QML Charts: How to edit font size of Axis
QtWS25 Last Chance

QML Charts: How to edit font size of Axis

Scheduled Pinned Locked Moved QML and Qt Quick
chartfont
2 Posts 2 Posters 5.3k 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.
  • M Offline
    M Offline
    morker
    wrote on 26 Mar 2015, 11:45 last edited by
    #1

    I didn't find a good solution to make my chart smaller...

    • How can I change the font size of the axisY and axisX?
    • How can I make the hole chart smaller?

    Rectangle {
    anchors.fill: parent

    ChartView {
        anchors.fill: parent
        anchors.topMargin: 10
        antialiasing: true
        backgroundColor: "#00000000"
        animationOptions: ChartView.SeriesAnimations
        legend.visible: false;
    
        LineSeries {
            id:  timelineDetailDayLineSeries
            color: "green"
            width: 4
    
            XYPoint { id: point1; x: 3; y: 0 }
            XYPoint { id: point2; x: 3; y: 4 }
            XYPoint { id: point3; x: 7; y: 4 }
            XYPoint { id: point4; x: 7; y: 0 }
    
            axisY: ValueAxis {
                min: 0.00
                max: 9.53
            }
    
            axisX: ValueAxis {
                tickCount: 10
                min: 0.00
                max: 10
            }
    
        }
    }
    

    }

    Many thanks!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Daniel Vaz
      wrote on 4 Aug 2016, 02:11 last edited by
      #2
      BarSeries {
              id: currentPlot
              axisX: BarCategoryAxis {
                  id: categoryAxis
                  labelsFont:Qt.font({pointSize: 6})
      

      Qt.font function accept an javascript object with all keys relevant to font.

      The most commonly used properties are:
      string font.family
      bool font.bold
      bool font.italic
      bool font.underline
      real font.pointSize
      int font.pixelSize

      1 Reply Last reply
      2

      • Login

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