소스 검색

simplify example

Falko Schindler 3 년 전
부모
커밋
2b07f15ccc
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 4
      main.py

+ 3 - 4
main.py

@@ -266,9 +266,9 @@ with example(ui.chart):
     from numpy.random import random
     from numpy.random import random
 
 
     def update():
     def update():
-        chart.view.options.series[0].data[:] = random(2)
+        chart.options.series[0].data[:] = random(2)
 
 
-    options = {
+    chart = ui.chart({
         'title': False,
         'title': False,
         'chart': {'type': 'bar'},
         'chart': {'type': 'bar'},
         'xAxis': {'categories': ['A', 'B']},
         'xAxis': {'categories': ['A', 'B']},
@@ -276,8 +276,7 @@ with example(ui.chart):
             {'name': 'Alpha', 'data': [0.1, 0.2]},
             {'name': 'Alpha', 'data': [0.1, 0.2]},
             {'name': 'Beta', 'data': [0.3, 0.4]},
             {'name': 'Beta', 'data': [0.3, 0.4]},
         ],
         ],
-    }
-    chart = ui.chart(options).classes('max-w-full h-64')
+    }).classes('max-w-full h-64')
     ui.button('Update', on_click=update)
     ui.button('Update', on_click=update)
 
 
 with example(ui.joystick):
 with example(ui.joystick):