Planned maintenance has been done but it did not solve the problem. So work will continue on this and a new time for trying updates will be announced asap.

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


Log in to reply