epezent / epezent/implot

real time data display problem

Open
#463 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
6.2k
Forks
693
PR merge metrics
No merged PRs in 30d

Description

I used imgui and implot for real-time display of temporal data and found the following problem:

When a series of data values remain constant (the bool variable is most pronounced and often remains in a state), after a few hours, the curve no longer displays. picture as follow

Some of the codes are as follows:

if (ImPlot::BeginPlot("",ImVec2(-1,0),ImPlotFlags_NoMenus) ){
ImPlot::SetupAxisScale(ImAxis_X1, ImPlotScale_Time);

if (i == rows - 1)
{
ImPlot::SetupAxes("", NULL, flags_axis, flags_axis);
}
else {
ImPlot::SetupAxes("", NULL, flags_axis | ImPlotAxisFlags_NoTickLabels, flags_axis);
}

for (int k = 0; k <= pltManager.pltVec[i].yMax; k++)
{
ImPlot::SetupAxis(ImAxis_Y1 + k, "", flags_axis);
}

ImPlot::SetupAxisLimits(ImAxis_X1, t - history, t, paused ? ImGuiCond_Once : ImGuiCond_Always);
ImPlot::SetupAxisLimits(ImAxis_Y1, 0, 1);
ImPlot::SetNextFillStyle(IMPLOT_AUTO_COL, 0.5f);

if (pltManager.pltVec.size() > 0)
{
for (int n = 0; n < pltManager.pltVec[i].plt.size(); n++)
{

int k = pltManager.pltVec[i].plt[n].lineIndex;

if (vecPltItem[k].isBIT)
{
ImPlot::SetupAxisLimits(ImAxis_Y1, 0, 1, ImGuiCond_Always);
}
else {
ImPlot::SetupAxisLimits(ImAxis_Y1, 0, 1);
}

ImPlot::SetAxis(pltManager.pltVec[i].plt[n].yIndex);
ImPlot::SetNextLineStyle(vecPltItem[k].Color);

if (vecPltItem[k].buffer.Data.size() == 0) continue;


if (vecPltItem[k].isBIT)
{
ImPlot::PlotDigital(
&vecPltItem[k].Label[0],
&vecPltItem[k].buffer.Data[0].x,
&vecPltItem[k].buffer.Data[0].y,
vecPltItem[k].buffer.Data.size(),
0,
vecPltItem[k].buffer.Offset,
2 * sizeof(double));
}
else {
ImPlot::PlotLine(
&vecPltItem[k].Label[0],
&vecPltItem[k].buffer.Data[0].x,
&vecPltItem[k].buffer.Data[0].y,
vecPltItem[k].buffer.Data.size(),
0,
vecPltItem[k].buffer.Offset,
2 * sizeof(double));
}

Please help me see how to troubleshoot this problem?
![image](https://user-images.githubusercontent.com/43022212/229658774-ca02787f-0244-406c-b1f0-bd9bd921e801.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.