Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Possible reapter bug
Qt 6.12 LTS is out! See what's new in the release blog

Possible reapter bug

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmlmchartsreapterpossible bug
1 Posts 1 Posters 288 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.
  • R Offline
    R Offline
    raketmus
    wrote on last edited by
    #1

    Hello i am trying to use mchart(A QML wrapper for chart.js).
    Now it needs to be passed a QList for the data i have multiple charts made by a reapter so i have stacked qlists like so:
    QList<QList<qreal>> Issue is when i use this i do the following

    Repeater
    {
        id: repeater
        model: 4
        Page
        {
             Component.onCompleted: {
                      console.log(index)
             }
             MChart
             {
                  width: parent.width + 60
                  height: 300
                  y: 290
                  anchors.horizontalCenter: parent.horizontalCenter
         
                  type: MChart.Type.Line
                  silent: true
                  labels: serial.labels[index]
         
                  data:
                  [
                       MDataset
                       {
                            values: serial.chartData[index]
                            fillColor: "#28bcd7"
                            lineColor: "#4328d7"
                            pointColor: "#2864d7"
                       }
                  ]
        }
    }
           
    

    serial.chartData is QList<QVarient> where the QVarient is a QList<qreal>.
    serial.labels is QList<QVarient> where the QVarient is a QList<QString>.
    I get the error ReferenceError: index is not defined at serial.labels[index]
    how can this be i can use index before this, but when i use it here it doesn't work.
    Is this a bug or am i doing something wrong?

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