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_chart_1.py (823B)

      1 # Create a chart
      2 chart = lv.chart(lv.scr_act())
      3 chart.set_size(200, 150)
      4 chart.center()
      5 chart.set_type(lv.chart.TYPE.LINE)   # Show lines and points too
      6 
      7 # Add two data series
      8 ser1 = chart.add_series(lv.palette_main(lv.PALETTE.RED), lv.chart.AXIS.PRIMARY_Y)
      9 ser2 = chart.add_series(lv.palette_main(lv.PALETTE.GREEN), lv.chart.AXIS.SECONDARY_Y)
     10 print(ser2)
     11 # Set next points on ser1
     12 chart.set_next_value(ser1,10)
     13 chart.set_next_value(ser1,10)
     14 chart.set_next_value(ser1,10)
     15 chart.set_next_value(ser1,10)
     16 chart.set_next_value(ser1,10)
     17 chart.set_next_value(ser1,10)
     18 chart.set_next_value(ser1,10)
     19 chart.set_next_value(ser1,30)
     20 chart.set_next_value(ser1,70)
     21 chart.set_next_value(ser1,90)
     22 
     23 # Directly set points on 'ser2'
     24 ser2.y_points = [90, 70, 65, 65, 65, 65, 65, 65, 65, 65]
     25 chart.refresh()      #  Required after direct set
     26