From 10:00 CET Friday 22nd November we will adjust how the server works to deal with some recently reported problems. Therefore there may be a load problem, if you experience more problems than usual trying to access the forum then please PM AndyS or any of the moderators so they can inform me.

QML Charts: How to edit font size of Axis

  • 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!

  • 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:
    bool font.bold
    bool font.italic
    bool font.underline
    real font.pointSize
    int font.pixelSize

Log in to reply