forked from streamlit/streamlit-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassemple_charts.py
40 lines (31 loc) · 1.29 KB
/
assemple_charts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from numpy.core.fromnumeric import size
class AssembleCharts:
""" Skapar ett komplett diagram utifrån ett eller flera chartobjekt """
def __init__(self, chart_exp, label_font_size: int = 14) -> None:
self.chart_exp = chart_exp
self.label_font_size = label_font_size
self.create_complete_charts()
def get_assembled_charts(self):
return self.chart_exp
def create_complete_charts(self):
self.add_configure_legend()
self.add_properties()
self.add_configure_title()
def add_configure_legend(self):
self.chart_exp = self.chart_exp.configure_legend(
orient="top-right",
title=None,
fillColor="#fbfbfc",
padding=0,
labelFontSize=14,
symbolStrokeWidth=10,
symbolType = "circle",
)
def add_properties(self):
self.chart_exp = self.chart_exp.properties(
width=420, height=420,
).configure_axis(
labelFontSize=self.label_font_size, labelAngle=0, titleFontSize=14
).configure_view(strokeWidth=0).configure_axis(gridOpacity=0.35, labelFontSize=14, labelOpacity = 0.65, domainOpacity=0.5)
def add_configure_title(self):
self.chart_exp = self.chart_exp.configure_title(fontSize=14)