gizak / termui

Golang terminal dashboard
MIT License
13.16k stars 787 forks source link

Barchart crashed system when all values are 0 #275

Open MadhavJivrajani opened 4 years ago

MadhavJivrajani commented 4 years ago

In the code for the barchart widget the heights are being divided by maxVal. But if maxVal is 0 then it is made equal to the maximum float from the data to be plotted. If all values in Data are zero this will potentially crash the system