-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stefan Kuethe
committed
Feb 20, 2024
1 parent
09679b3
commit 69b745c
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from pandas import DataFrame | ||
from shiny.express import ui | ||
from shinyecharts.express import Chart, InitOptions, SeriesType | ||
from shinyecharts.renderer import ChartRenderer | ||
|
||
init_options = InitOptions(width=600, height=400, renderer="canvas") | ||
|
||
data = DataFrame(dict(a=[1, 2, 3, 4], b=[2, 4, 8, 4], c=[3, -2, 3, 1])) | ||
|
||
pie_data = DataFrame(dict(name=["A", "B", "C"], value=[10, 70, 40])) | ||
|
||
|
||
@ChartRenderer | ||
def render_line_chart(): | ||
return Chart().data(data).encode("a", "b").encode("a", "c", color="pink") | ||
|
||
|
||
@ChartRenderer | ||
def render_pie_chart(): | ||
return Chart().data(pie_data).series("pie") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters