Skip to content

ImGui::PlotLines doesn't draw lines when all values are the same #1621

@ghost

Description

Using imgui 1.50 with love.imgui on Windows 10 and Ubuntu 17.10.

When drawing a graph with ImGui::PlotLines where all values are the same, no lines are visible.

In the pictures, the top graph adds some extra values so that the graph is always visible (since it's common to remain at 60 FPS for extended periods of time). The bottom graph also does this, but it appends zeros, so when it's all zeros, nothing is visible.

Example of data where lines are drawn:
data

Example of data where no lines are drawn for the file access graph.
no_data

Example Lua code:

local values = {}
for i = 1, 120 do
    values[i] = 0
end

imgui.PlotLines("graph", values, #values)

Untested C++ code:

float lines[120];
ImGui::PlotLines("graph", lines, 120);

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions