<?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[QChart update performance when adding QXYSeries::PointConfiguration]]></title><description><![CDATA[<p dir="auto">I have a screen with three QCharts displaying raw data that comes from a server. On receiving several seconds of data (2K-4K points) I need to update the chart with certain regions highlighted using<br />
<code>QXYSeries::PointConfiguration</code><br />
I gather the actual data points into a QList&lt;QpointF&gt; then call<br />
<code>QLineSeries::replace(QList&lt;QPointF&gt;)</code><br />
Then I need to highlight several regions of data. I have not found a similar method  like the replace function what will apply the configuration in one go, perhaps being faster.<br />
Here is some pseudo code to give an idea what I am doing:<br />
First is a method to gather the data from the raw data structure (TDADataMap):</p>
<pre><code>void Realtimeplot0::FinishPlot(TDADataMap *pDataMap, short srsct) {
    MultiLineSeries *thisSrs = GetLineSeries(srsct);// handles getting specific LineSeries stored in the class
      // Get the raw data structures to pull data from
      // plotx and ploty are integers set elsewhere
     TDADataList *pDataListx = pDataMap-&gt;find(plotx);
     TDADataList *pDataListy = pDataMap-&gt;find(ploty);
     quint32 ct = pDataListy-&gt;size();
     quint32 curpos=0;
    qreal tmpx, tmpy;
    QList&lt;QPointF&gt; fnshlst;
    while (curpos &lt; ct){
        ptry = (*pDataListy)[unsigned(curpos)];
        ptrx = (*pDataListx)[unsigned(curpos)];
        tmpx = ptrx.GetTimeSec();
        tmpy = ptry.GetRealValue();
        fnshlst.append(QPointF(tmpx,tmpy);
        curpos++;
    }
    thisSrs-&gt;appendData(fnshlst);
    if (!m_brthPosns.isEmpty())
        // sets colors for the given QLineSeries
        setBrthColors(srsct);
}
</code></pre>
<p dir="auto">Here is outline of the class method to set colors:</p>
<pre><code>void Realtimeplot0::MultiLineSeries::setBrthColors(short srsct){
    QHash&lt;QXYSeries::PointConfiguration, QVariant&gt; conf;
    conf[QXYSeries::PointConfiguration::Color] = QColor(Qt::darkYellow);
    conf[QXYSeries::PointConfiguration::Size] = 1;
    conf[QXYSeries::PointConfiguration::LabelVisibility] = false;

    MultiLineSeries *thisSrs = GetLineSeries(srsct);
    // we iterate into the class object
    m_brthPosns:QList&lt;BrthPosnPlots&gt;::iterator brthItr = m_brthPosns.begin();
    // grab the data from the series:
    QList&lt;QPointF&gt; srspts = thisSrs-&gt;points();
    quint32 ctSrs = srspts.size();
    unsigned bpos;
    for (brthItr = m_brthPosns.begin(); brthItr != m_brthPosns.end(); brthItr++) {
        for (bpos = (*brthItr).GetEIPos(); bpos &lt; (*brthItr).GetEEPos(); bpos++) {
            thisSrs-&gt;setPointConfiguration(bpos, conf);
    }

}
</code></pre>
<p dir="auto">My question is: is there a way to collect the conf objects into a QList or something like to submit to the QLineSeries-derived class?<br />
Or any other suggestions to speed this up. The appendData method takes 20 msec, but the setBrthColors takes nearly 2 sec for a set of about 3K data points.<br />
Here is screen shot of one of the three QCharts that gets colored:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/7af20693-b9d7-4202-aa37-247b8f226d5c.png" alt="6ddca419-585e-4fe0-96ea-5371583f716b-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/164287/qchart-update-performance-when-adding-qxyseries-pointconfiguration</link><generator>RSS for Node</generator><lastBuildDate>Wed, 06 May 2026 10:45:48 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164287.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Feb 2026 23:04:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QChart update performance when adding QXYSeries::PointConfiguration on Thu, 19 Feb 2026 17:25:18 GMT]]></title><description><![CDATA[<p dir="auto">Thanks, solution found, similar to what you are suggesting.<br />
I dug a bit further into Qt docs and found the entry for setPointsConfiguration, which takes data in the form of</p>
<pre><code>QHash&lt;int, QHash&lt;QXYSeries::PointConfiguration, QVariant&gt;&gt;
</code></pre>
<p dir="auto">So my new code for setting the colors looks like:</p>
<pre><code>        QHash&lt;int, QHash&lt;QXYSeries::PointConfiguration, QVariant&gt;&gt; ptsConfig;
        QList&lt;BrthPosnPlots&gt;::iterator brthItr = m_brthPosns.begin();
        MultiLineSeries *thisSrs = GetLineSeries(srs);

        QList&lt;QPointF&gt; srspts = thisSrs-&gt;points();
        quint32 ctSrs = srspts.size();
        if ((ctSrs &lt; 1))
            return;
        qsizetype bpos;
        for (brthItr = m_brthPosns.begin(); brthItr != m_brthPosns.end(); brthItr++) {
            if ((*brthItr).GetEEPos() &gt; ctSrs)
                continue;
            if (((*brthItr).GetEIPos() &gt; 1) &amp;&amp; ((*brthItr).GetEEPos() &gt; (*brthItr).GetEIPos() + 5)) {
                for (bpos = (*brthItr).GetEIPos(); bpos &lt; (*brthItr).GetEEPos(); bpos++) {
                    ptsConfig.insert_or_assign(bpos, conf);
                    // thisSrs-&gt;setPointConfiguration(bpos, conf);
                }
            }
        }
        if (!ptsConfig.isEmpty()) {
            thisSrs-&gt;setPointsConfiguration(ptsConfig);
        }
</code></pre>
<p dir="auto">The speedup is truly amazing! From over 2 sec down to &lt; 20 msec for this method.<br />
Thanks to all for feedback and tips.</p>
]]></description><link>https://forum.qt.io/post/836432</link><guid isPermaLink="true">https://forum.qt.io/post/836432</guid><dc:creator><![CDATA[nekkceb]]></dc:creator><pubDate>Thu, 19 Feb 2026 17:25:18 GMT</pubDate></item><item><title><![CDATA[Reply to QChart update performance when adding QXYSeries::PointConfiguration on Thu, 19 Feb 2026 15:02:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nekkceb">@<bdi>nekkceb</bdi></a><br />
You might want to read what Googling for <code>qt PointConfiguration slow</code> has to say.</p>
<blockquote>
<p dir="auto">If using QXYSeries, avoid individual updates in a tight loop. Instead, prepare the configuration data (e.g., QList&lt;QPointConfiguration&gt;) and apply it in a single batch update if possible, or use signalsBlocked(true) while updating to prevent redundant repaints</p>
</blockquote>
<blockquote>
<p dir="auto">If the application is still slow, consider using QChart's signalsBlocked(true) trick to only update the visual representation periodically rather than on every single data point change</p>
</blockquote>
<p dir="auto"><a href="https://stackoverflow.com/a/63258832/489865" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/a/63258832/489865</a></p>
<p dir="auto">Worth a try?</p>
<p dir="auto">Meanwhile, be aware that Qt Charts has been assassinated, to be replaced by <a href="https://doc.qt.io/qt-6/qtgraphs-index.html" target="_blank" rel="noopener noreferrer nofollow ugc">Qt Graphs</a>.  Whether that has the same features or exhibits the same behaviour I do not know, but there certainly will be no more changes in Qt Charts and you will have to move off it at some point....</p>
]]></description><link>https://forum.qt.io/post/836425</link><guid isPermaLink="true">https://forum.qt.io/post/836425</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 19 Feb 2026 15:02:03 GMT</pubDate></item><item><title><![CDATA[Reply to QChart update performance when adding QXYSeries::PointConfiguration on Thu, 19 Feb 2026 14:47:43 GMT]]></title><description><![CDATA[<p dir="auto">You are right, the underlying data comes in a 100 Hz, so trying to show 30+ sec (3K points) does seem overkill. I will look into your solution, but right now it seems that would be a lot of coding to update the data points on the QChart to match a zoom level!<br />
Given the rather large difference in speed it takes to update the raw data (updated from a QList) vs the configuration points (updated pt-by-point), it would be nice if there were a way to update point configuration in chunks in a somewhat similar manner. When I changed the code to add raw data to the chart pt-by-pt, the speed was actually close to the speed the point configuration routine takes (1000-fold difference in speed!).</p>
]]></description><link>https://forum.qt.io/post/836423</link><guid isPermaLink="true">https://forum.qt.io/post/836423</guid><dc:creator><![CDATA[nekkceb]]></dc:creator><pubDate>Thu, 19 Feb 2026 14:47:43 GMT</pubDate></item><item><title><![CDATA[Reply to QChart update performance when adding QXYSeries::PointConfiguration on Thu, 19 Feb 2026 09:29:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nekkceb">@<bdi>nekkceb</bdi></a></p>
<p dir="auto">Hi, you can always reduce the number of data points shown at a time, and go into more details when your chart is zoomed-in.<br />
From the screenshot you can see that there are many "groups" where a large amount of data points are clustered and where you won't be able to spot any single data point with the naked eye.</p>
]]></description><link>https://forum.qt.io/post/836408</link><guid isPermaLink="true">https://forum.qt.io/post/836408</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Thu, 19 Feb 2026 09:29:03 GMT</pubDate></item></channel></rss>