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 gridline styling
Forum Update on Monday, May 27th 2025

QML charts gridline styling

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 331 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.
  • E Offline
    E Offline
    EqiupmentConnected
    wrote on last edited by
    #1

    I'm using a ChartView with LineSeries and I'd like to make the grid lines dotted or very thin but I can't find anything that tells me how to do it or if it is possible. I tried using gridLinePen but it gives me the error "Unable to assign int to QPen". Can this be done with a QML chart?

    ChartView
    {
    id: line

                anchors.fill: parent
                backgroundColor: "black"
                legend.visible: false
    
                ValuesAxis
                {
                    id: xAxis
    
                    min: -12
                    max: 12
    
                    tickCount: 12
    
                    gridLinePen:
                    {   style: Qt.DotLine } // does not work
    
                    gridLineColor: "green"
                    gridVisible: True
                    minorGridVisible: True
                }
    
                ValuesAxis
                {
                    id: yAxis
    
                    min: 0
                    max: 70
    
                    tickCount: 40
                    gridLineColor: "green"
                    gridLinePen: { style: Qt.DotLine }  // does not work
                }
    
                LineSeries
                {
                    id:ls1
                    name: "1"
    
                    axisX: xAxis
                    axisY: yAxis
    
                    color: "cyan"
                    width: 4
                }
    
                LineSeries
                {
                    id:ls2
                    name: "1"
    
                    color: "cyan"
                    width: 4
                }
            }
        }
    
    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