Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75735

Cant display both QLineSeries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.2
    • Fix Version/s: None
    • Component/s: Charts
    • Labels:
      None
    • Environment:
      Qt Creator 4.9.0
      Qt 5.12.2
      Windows 10
    • Platform/s:
      Windows

      Description

      In this code snippet, I'm trying to display a graph with two series. For faster output, I delete, fill in the Series, and then add them back. The problem is that when you delete and add Series 2 at the same time is not displayed.

      • Series 1(Red Line) — This is a normal random function.
      • Series 2(Green Line) — level 0, for the test at the moment 400.

      In this case, only Series1 will be displayed:

       

      Series1->clear();
      Series2->clear();
      
      Chart1->removeSeries(Series1);
      Chart1->removeSeries(Series2);
      
      for(int i=0; i<dataArray.size()-1; i++)
      {
         Series1->append(i, dataArray[i]);
         Series2->append(i, 400);
      }
      
      axisX->setRange(firstCount, secondCount);
      axisY->setRange(minValueOfDataArray, maxValueOfDataArray);
      axisZero->setRange(minValueOfDataArray, maxValueOfDataArray);
      
      Chart1->addSeries(Series1);
      Chart1->addSeries(Series2);

       

      If I delete only Series1, then everything will work correctly and Series2 will also appear, but the output will be very slow, and for big data the program will completely fall: 

      Series1->clear();
      Series2->clear();
      
      Chart1->removeSeries(Series1);
      //Chart1->removeSeries(Series2);
      
      for(int i=0; i<dataArray.size()-1; i++)
      {
         Series1->append(i, dataArray[i]);
         Series2->append(i, 400);
      }
      
      axisX->setRange(firstCount, secondCount);
      axisY->setRange(minValueOfDataArray, maxValueOfDataArray);
      axisZero->setRange(minValueOfDataArray, maxValueOfDataArray);
      Chart1->addSeries(Series1);
      //Chart1->addSeries(Series2);
      

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            e0348803 Miikka Heikkinen
            Reporter:
            supp Mihail Nikitin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes