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. Multiple charts on same QML page
Forum Updated to NodeBB v4.3 + New Features

Multiple charts on same QML page

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 355 Views 1 Watching
  • 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.
  • F Offline
    F Offline
    filipdns
    wrote on last edited by filipdns
    #1

    Hi, I need to display multiple charts on QML page like picture below

    Sans titre.jpg

    Data is from sqlite table and I want to have code using repeater or like it because I will have 10 to 20 charts to display.

    Do you know how can I do that?

    Kind rgards

    Philippe

    F 1 Reply Last reply
    0
    • F filipdns

      Hi, I need to display multiple charts on QML page like picture below

      Sans titre.jpg

      Data is from sqlite table and I want to have code using repeater or like it because I will have 10 to 20 charts to display.

      Do you know how can I do that?

      Kind rgards

      Philippe

      F Offline
      F Offline
      filipdns
      wrote on last edited by
      #2

      @filipdns
      Hello, I'm trying what I need with the code below:
      function numberGraph()
      {
      var count= StringList.mecanoList().length
      for(var i=0;i<count;i++)
      {
      var trigramme=StringList.mecanoList()[i]
      console.log(trigramme)
      modelId.append({'mColor': 'blue','names':trigramme})
      }
      }

      ListModel {
          id: modelId
      }
      BarCategoryAxis {id:categoryaxis; categories: ["2007", "2008", "2009", "2010", "2011","2012"] }
      Rectangle {
          id: rectId
          color: "transparent"
          anchors.fill: parent
          
          GridView {
              id: mGridViewId
              //anchors.fill: parent
              width: parent.width;
              height: parent.height
              cellWidth: parent.width;
              cellHeight: 300
              model: modelId
              delegate: Rectangle {
                  width: mGridViewId.cellWidth;
                  height: mGridViewId.cellHeight
                  color: mColor
                  
                  ChartView {
                      width: parent.width;
                      height: parent.height
                      title:names
                      StackedBarSeries {
                          
                          axisX:categoryaxis                        
                          BarSet {id:free; label: "Free";values:[1,2,1,3]}
                          BarSet {id:duty; label: "Duty";values:[1,2,5,0]}
                          BarSet {id:off; label: "OFF";values:[5,3,1,4];color:"red"}
                      }
                      
                  }
              }
          }
      }
      

      StackedBarSeries Charts are build fine but when I'm trying to scroll down, the application crash when I'm passing the seventh charts without any information on the reason, only the console message:

      "Can not find series on the chart."
      Trying to set axisX to null.

      Could you help me please?

      Kind regards

      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