acid-drop- Hacking the planet from a LilyGo T-Deck using custom firmware |
git clone git://git.acid.vegas/acid-drop.git |
Log | Files | Refs | Archive | README | LICENSE |
lv_example_meter_4.py (997B)
1 # 2 # Create a pie chart 3 # 4 5 meter = lv.meter(lv.scr_act()) 6 7 # Remove the background and the circle from the middle 8 meter.remove_style(None, lv.PART.MAIN) 9 meter.remove_style(None, lv.PART.INDICATOR) 10 11 meter.set_size(200, 200) 12 meter.center() 13 14 # Add a scale first with no ticks. 15 scale = meter.add_scale() 16 meter.set_scale_ticks(scale, 0, 0, 0, lv.color_black()) 17 meter.set_scale_range(scale, 0, 100, 360, 0) 18 19 # Add a three arc indicator* 20 indic_w = 100 21 indic1 = meter.add_arc(scale, indic_w,lv.palette_main(lv.PALETTE.ORANGE), 0) 22 meter.set_indicator_start_value(indic1, 0) 23 meter.set_indicator_end_value(indic1, 40) 24 25 indic2 = meter.add_arc(scale, indic_w, lv.palette_main(lv.PALETTE.YELLOW), 0) 26 meter.set_indicator_start_value(indic2, 40) # Start from the previous 27 meter.set_indicator_end_value(indic2, 80) 28 29 indic3 = meter.add_arc(scale, indic_w, lv.palette_main(lv.PALETTE.DEEP_ORANGE), 0) 30 meter.set_indicator_start_value(indic3, 80) # Start from the previous 31 meter.set_indicator_end_value(indic3, 100) 32