瀏覽代碼

Update echart_documentation.py

thetableman 1 年之前
父節點
當前提交
eb89fb28d9
共有 1 個文件被更改,包括 17 次插入0 次删除
  1. 17 0
      website/more_documentation/echart_documentation.py

+ 17 - 0
website/more_documentation/echart_documentation.py

@@ -19,3 +19,20 @@ def main_demo() -> None:
         echart.update()
 
     ui.button('Update', on_click=update)
+    
+
+def more() -> None:
+    @text_demo('Chart with clickable points', '''
+        You can register a callback for an event when a series point is clicked.
+    ''')
+    def click() -> None:
+        echart = ui.echart({
+            'xAxis': {'type': 'category'},
+            'yAxis': {'type': 'value', 'data': 'A', 'inverse': True},
+            'legend': {'textStyle': {'color': 'gray'}},
+            'series': [
+                {'type': 'line', 'name': 'Alpha', 'data': [20, 10, 30, 50, 40, 30]},
+            ],
+        },
+        on_point_click=lambda e: ui.notify(f'Click {e}')
+        ).classes('w-full h-64')