Skip to content

Plotting data #1772

@kenkit

Description

@kenkit

Hi,
I'm using IMGUI as the default user interface for all my apps since it's easy to use. However I've noticed that there is little information/documentation on the api.
Ok, my current problem is that I have a histogram which is an arrary of floats which is updated every second incrementally, if the value reaches max it resets to 0. The problem is the graph iteself begins repeating while ovewriting the existing values instead of moving the whole thing to one side.
Here is part of my code

  if (diff.total_milliseconds() >= 1000) {
                upload_log[current_ul_log] = graph_rt;//--this is the value I'm plotting
                last_ulspeed = graph_rt;
                current_ul_log++;
            }

 ImGui::PlotHistogram("Log", upload_log, IM_ARRAYSIZE(upload_log),
                current_log, std::string("speed " + std::to_string(upload_speed) + std::string(rate[current_rate].symbol)).c_str(), 0.0f, max_ul_value, ImVec2(0, 80));

So my question is do I have to iterate over the whole array just to make it look like it's moving ?
I didn't see this being done in the examples, I thought of using a vector but I don't know how to do it.
Any help will be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions