Skip to content

Commit

Permalink
demonstrate ui.chart with extra dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Jul 16, 2023
1 parent 314f133 commit 824abac
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions website/more_documentation/chart_documentation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from nicegui import ui

from ..documentation_tools import text_demo


def main_demo() -> None:
from random import random
Expand All @@ -19,3 +21,22 @@ def update():
chart.update()

ui.button('Update', on_click=update)


def more() -> None:
@text_demo('Chart with extra dependencies', '''
To use a chart type that is not included in the default dependencies, you can specify extra dependencies.
This demo shows a solid gauge chart.
''')
def extra_dependencies() -> None:
ui.chart({
'title': False,
'chart': {'type': 'solidgauge'},
'yAxis': {
'min': 0,
'max': 1,
},
'series': [
{'data': [0.42]},
],
}, extras=['solid-gauge']).classes('w-full h-64')

0 comments on commit 824abac

Please sign in to comment.