diff --git a/gui.py b/gui.py index 539027e..5f124ef 100644 --- a/gui.py +++ b/gui.py @@ -2188,11 +2188,11 @@ class App: dpg.add_text("Frame:") dpg.add_text("0.0ms", tag="perf_frame_text", color=(100, 200, 255)) - with dpg.add_plot(label="Frame Time (ms)", height=100, width=-1, no_mouse_pos=True): - dpg.add_plot_axis(dpg.mvXAxis, label="samples", no_tick_labels=True) - with dpg.plot_axis(dpg.mvYAxis, label="ms"): - dpg.add_line_series(list(range(100)), self.perf_history["frame_time"], label="frame time", tag="perf_frame_plot") - dpg.set_axis_limits(dpg.last_item(), 0, 50) + dpg.add_plot(label="Frame Time (ms)", tag="plot_frame", height=100, width=-1, no_mouse_pos=True) + dpg.add_plot_axis(dpg.mvXAxis, label="samples", no_tick_labels=True, parent="plot_frame") + with dpg.plot_axis(dpg.mvYAxis, label="ms", tag="axis_frame_y", parent="plot_frame"): + dpg.add_line_series(list(range(100)), self.perf_history["frame_time"], label="frame time", tag="perf_frame_plot") + dpg.set_axis_limits("axis_frame_y", 0, 50) with dpg.group(horizontal=True): dpg.add_text("CPU:") @@ -2201,11 +2201,11 @@ class App: dpg.add_text("Input Lag:") dpg.add_text("0.0ms", tag="perf_lag_text", color=(255, 180, 80)) - with dpg.add_plot(label="CPU Usage (%)", height=100, width=-1, no_mouse_pos=True): - dpg.add_plot_axis(dpg.mvXAxis, label="samples", no_tick_labels=True) - with dpg.plot_axis(dpg.mvYAxis, label="%"): - dpg.add_line_series(list(range(100)), self.perf_history["cpu"], label="cpu usage", tag="perf_cpu_plot") - dpg.set_axis_limits(dpg.last_item(), 0, 100) + dpg.add_plot(label="CPU Usage (%)", tag="plot_cpu", height=100, width=-1, no_mouse_pos=True) + dpg.add_plot_axis(dpg.mvXAxis, label="samples", no_tick_labels=True, parent="plot_cpu") + with dpg.plot_axis(dpg.mvYAxis, label="%", tag="axis_cpu_y", parent="plot_cpu"): + dpg.add_line_series(list(range(100)), self.perf_history["cpu"], label="cpu usage", tag="perf_cpu_plot") + dpg.set_axis_limits("axis_cpu_y", 0, 100) def run(self): dpg.create_context()