hoffstadt / DearPyGui

Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
https://dearpygui.readthedocs.io/en
MIT License
13.03k stars 678 forks source link

add_custom_series crashed when channel_count > 2 #2307

Open LibrarristShalinward opened 6 months ago

LibrarristShalinward commented 6 months ago

Version of Dear PyGui

Version: 1.11.0(also encountered this bug in 1.8.0) Operating System: Windows 10

My Issue/Question

When channel_count is set more than 2 in add_custom_series, the viewport will crash in the next rendering (calling start_dearpygui or render_dearpygui_frame), before calling the callback sent to add_custom_series.

To Reproduce

Run the example and you will see the viewport appear for a while and then crashed, with nothing (any error or the "callback") shown in the command window.

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport()
dpg.setup_dearpygui()

x_data = [0.0, 1.0, 2.0, 4.0, 5.0]
y_data = [0.0, 10.0, 20.0, 40.0, 50.0]
y1_data = [0.0, 0.0, 0.0, 0.0, 0.0]

def callback(*args, **kwargs):
    print("callback")

with dpg.window(label="Tutorial") as win:
    with dpg.plot(label="Custom Series", height=400, width=-1):
        xaxis = dpg.add_plot_axis(dpg.mvXAxis)
        with dpg.plot_axis(dpg.mvYAxis):
            dpg.add_custom_series(x = x_data, y = y_data, y1 = y1_data, channel_count = 3, label = "Custom Series", callback = callback)

dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
ruguevara commented 6 months ago

I can confirm this bug