QML chart not shown
Unsolved
QML and Qt Quick
-
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.2ChartView {
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 ) }
}
-
Are you able to run the example given on your box ? Side note.. It is QML !UML:)
-
@dheerendra
Yes, the original examples are okay. Sorry for typo, there are just too many acronyms... XD -
-
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:
- Assign width and height to the chartView.
- Assign a Axis to the CandlestickSeries.