Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to instantiate QScatterSeries dynamically for multiple data sets so I can paint them separately and plot into a Q3DScatter?
Forum Update on Monday, May 27th 2025

How to instantiate QScatterSeries dynamically for multiple data sets so I can paint them separately and plot into a Q3DScatter?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 190 Views
  • 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.
  • E Offline
    E Offline
    Electrolite
    wrote on last edited by Electrolite
    #1

    So I'm trying to plot a 3D scatter. I have multiple data sets to plot and each one must have a different color. We can only change color of entire series associated with a scatter, so I have to create multiple series for my scatter, and change the color of each series.

    My data is stored in .txt files, during the execution the user selects the data sets to plot and it's color, the address of those data set files is saved in matrix alongside the desired colors of each data set then during plot I open those files and load the data to a matrix of float numbers.

    The issue is: I don't know how many data sets I will plot. How can I instantiate multiple series during execution to hold data for those multiple data set so I can paint them separately?

    I tried to use a Qlist that contains QScatterSeries. Then I append the data in this list. I expected that each item in the list would be a different series but when I tried to paint each series in the Qlist the program painted the entire thing one color as if it was a single series only.

    My solution was to create ifs that based on how many data sets were selected to plot will instantiated a different number of series (up to 3 series) inside each if case. But this is ugly, we have multiple blocks of ifs that are never used and it limits the number of data sets we can use.

    Any solution to this?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved