Using this post as inspiration, Pie chart labels - #6 by zxcslo,
I have data from a SQL query, two columns, name and seconds (sum). I want to display the seconds as HH:mm:ss. I tried the following code, it doesn’t work, it locks the designer.
I also tried returning from SQL as string in HH:mm:ss, but then the value is displaysed as date from 1970 (I just want HH:mm:ss). I tried to format or parse in the above code and that also locked up the designer. What else can I do on this?
‘Locking’ the designer is odd, that probably means the script is going into an infinite loop somehow.
What if you change generateSectionLabel to return a constant string? e.g.
It sounds like there might be an uncaught exception happening in your timedelta code then. Try wrapping it in a try: except: block? To see if you can find out the error; it won’t actually fix anything.
It goes bonkers. The interesting thing is I can't interact with anything on the window, but I can the project browser. I can edit the component in the browser, by disabling the extension. But, even after disabling, the window is still "locked' up. I have to restart the designer. I guess I will give IA a call.
Exception in thread "AWT-EventQueue-0" Traceback (most recent call last):
File "<extension-method configureChart>", line 21, in generateSectionLabel
File "C:\Users\pgriffith\Projects\ignition\IDE-Launchers\gateway-launcher\src\main\home\user-lib\pylib\datetime.py", line 500, in __new__
seconds += minutes*60 + hours*3600
TypeError: cannot concatenate 'unicode' and 'int' objects
Exception in thread "AWT-EventQueue-0" Traceback (most recent call last):
File "<extension-method configureChart>", line 21, in generateSectionLabel
ValueError: invalid literal for int() with base 10: '15%'