Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QML chart not shown

    QML and Qt Quick
    4
    5
    1233
    Loading More Posts
    • 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.
    • Y
      ymhsieh last edited by

      I'm experimenting QML chart with data loaded by JS. I'm almost certain the following UML is correct, but all I got is blank. Any tip/hint so that I can get it displayed correctly?
      (p.s. The UML is modified from the example at: https://doc.qt.io/qt-5/qml-qtcharts-candlestickseries.html)

      import QtQuick 2.5
      import QtCharts 2.2

      ChartView {
      title: "Candlestick Series"

      CandlestickSeries {
          id: s2
          name: "Another Ltd."
          increasingColor: "white"
          decreasingColor: "black"
      }
      
      Component.onCompleted: {
          var tmp = Qt.createQmlObject("import QtCharts 2.2; CandlestickSet { timestamp: 1435708800000; open: 690; high: 694; low: 599; close: 660 }", s2);
          s2.append( tmp )
          var tmp = Qt.createQmlObject("import QtCharts 2.2; CandlestickSet { timestamp: 1435795200000; open: 669; high: 669; low: 669; close: 669 }", s2);
          s2.append( tmp )
          var tmp = Qt.createQmlObject("import QtCharts 2.2; CandlestickSet { timestamp: 1436140800000; open: 485; high: 623; low: 485; close: 600 }", s2);
          s2.append( tmp )
          var tmp = Qt.createQmlObject("import QtCharts 2.2; CandlestickSet { timestamp: 1436227200000; open: 589; high: 615; low: 377; close: 569 }", s2);
          s2.append( tmp )
          // var tmp = Qt.createQmlObject("import QtCharts 2.2; CandlestickSet { timestamp: 1436313600000; open: 464; high: 464; low: 254; close: 254 }", s2);
          // s2.append( tmp )
      }
      

      }

      P 1 Reply Last reply Reply Quote 0
      • dheerendra
        dheerendra Qt Champions 2022 last edited by

        Are you able to run the example given on your box ? Side note.. It is QML !UML:)

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        Y S 2 Replies Last reply Reply Quote 2
        • Y
          ymhsieh @dheerendra last edited by

          @dheerendra
          Yes, the original examples are okay. Sorry for typo, there are just too many acronyms... XD

          1 Reply Last reply Reply Quote 0
          • S
            serg_ganz @dheerendra last edited by

            @dheerendra

            the same problem

            would you please provide a 100% working example.

            thnx

            1 Reply Last reply Reply Quote 0
            • P
              pra7 @ymhsieh last edited by

              @ymhsieh

              Before looking to the issue i was getting lot of errors in the console "PainterPath::lineTo: Adding point where x or y is NaN or Inf, ignoring call" .

              Comming to the code:

              1. Assign width and height to the chartView.
              2. Assign a Axis to the CandlestickSeries.
              1 Reply Last reply Reply Quote 0
              • First post
                Last post