fish 1 year ago
parent
commit
1378977169
3 changed files with 3 additions and 2 deletions
  1. 1 1
      demo/app/app.py
  2. 1 1
      demo/app/pages/plotly_chart.py
  3. 1 0
      demo/app/pages/todo.py

+ 1 - 1
demo/app/app.py

@@ -55,7 +55,7 @@ class App(UserControl):
             elif e.control.selected_index == 2:
                 content.controls.append(ft.Text("商品库!"))
             elif e.control.selected_index == 3:
-                fig = ChartPage().DrawChart()
+                fig = ChartPage().draw_chart()
                 # fig.show()
                 content.controls.append(PlotlyChart(fig, expand=True))
             elif e.control.selected_index == 4:

+ 1 - 1
demo/app/pages/plotly_chart.py

@@ -12,7 +12,7 @@ from flet.matplotlib_chart import MatplotlibChart
 class ChartPage():
     '''chart page '''
     
-    def DrawChart(self):
+    def draw_chart(self):
         ''' draw chart  '''
         x = ['day 1', 'day 1', 'day 1', 'day 1', 'day 1', 'day 1',
              'day 2', 'day 2', 'day 2', 'day 2', 'day 2', 'day 2']

+ 1 - 0
demo/app/pages/todo.py

@@ -6,6 +6,7 @@ class TodoPage(Column):
     ''' todo page '''
 
     def add_clicked(self, e):
+        '''增加点击事件'''
         if self.new_task.value:
             self.list.controls.append(ft.Checkbox(label=self.new_task.value))
             self.new_task.value = ""