<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to update QML chart during runtime ?]]></title><description><![CDATA[<p dir="auto">I found this <a href="https://github.com/shuirna/QMLChartJs" target="_blank" rel="noopener noreferrer nofollow ugc">link </a> in this forum. It works fine after integrating into my application. But i am not able to add data during runtime and not able to display it.</p>
<ol>
<li>In QMLChartData.Js<br />
How to push data to the variable <strong>data</strong>.</li>
</ol>
<pre><code>var ChartLineData = {
      labels: ["January","February","March","April","May","June","July","January","February","March","April","May","June","July"],
    datasets: [{
        fillColor : "rgba(220,220,220,0.2)",
        strokeColor : "rgba(220,220,220,1)",
        pointColor : "rgba(220,220,220,1)",
        pointStrokeColor : "#fff",
        pointHighlightFill : "#fff",
        pointHighlightStroke : "rgba(220,220,220,1)",
        **data **: [20,20,40,50,4,35,100,200]
    }]
}
</code></pre>
<p dir="auto">Since i have imported and binded like this<br />
<code>import "QMLChartData.js" as ChartsData</code><br />
<code>property var chartLineData: ChartsData.ChartLineData</code><br />
//push new data<br />
<code>chartLineData.datasets.data.push(100);// It says cannot call method push of undefined.</code></p>
<p dir="auto">But I am able to push data to labels.<br />
<code>chartLineData.labels.push("december") </code><br />
<code>chart_line.requestPaint()</code><br />
but not able to display it on the graph even though i called reqeustPaint().Any help please. I just want to draw a line graph based on the data from cpp side.Any example would be really helpful. Thanks</p>
]]></description><link>https://forum.qt.io/topic/57546/how-to-update-qml-chart-during-runtime</link><generator>RSS for Node</generator><lastBuildDate>Mon, 23 Nov 2026 01:02:44 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/57546.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 07 Aug 2015 06:49:20 GMT</pubDate><ttl>60</ttl></channel></rss>