ESP-DASH
ESP-DASH copied to clipboard
[BUG]chart example
Describe the bug I tried to put 101 data in the XAxis and YAxis array . But char can only display about 24 bars. But if i put 50 data in XAxis and YAxis array, it can display all the data correctly.
To Reproduce Steps to reproduce the behavior:
- change the length of the XAxis as: String XAxis[101]
- change the length of the YAxis as : int YAxis[101]
- in the setup function, change the length of the XAxis as: power.updateX(XAxis, 101)
- in the loop function, change the length of the YAxis as :
for(int i=0; i < 101; i++){ YAxis[i] = (int)random(0, 200); power.updateY(YAxis, 101);
Expected behavior A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context Great work, thanks.
Hi @bpesun,
This will be fixed with the V4 release which is just around the corner.
Causes:
-
Currently, the charts work by copying all the array data into the heap which creates a less than ideal environment for large data.
-
String class in itself consumes a lot of memory and creating an array of strings with 101 elements will also limit your memory by a lot.
Solution:
For V3, the best thing is to consolidate a large dataset into smaller entries that can easily be displayed by the microcontroller without going out of memory.
Thanks a lot.