Creates a JavaScript pie chart using "HighCharts". @Params chart_name - If creating multiple charts, use this to select which one. title - The title displayed for the chart. subtitle - The subtitle displayed for the chart. data_name - The
(
self,
chart_name=None,
title=None,
subtitle=None,
data_name=None,
unit=None,
libs=True,
labels=True,
legend=True,
)
| 12666 | ############ |
| 12667 | |
| 12668 | def create_pie_chart( |
| 12669 | self, |
| 12670 | chart_name=None, |
| 12671 | title=None, |
| 12672 | subtitle=None, |
| 12673 | data_name=None, |
| 12674 | unit=None, |
| 12675 | libs=True, |
| 12676 | labels=True, |
| 12677 | legend=True, |
| 12678 | ): |
| 12679 | """Creates a JavaScript pie chart using "HighCharts". |
| 12680 | @Params |
| 12681 | chart_name - If creating multiple charts, |
| 12682 | use this to select which one. |
| 12683 | title - The title displayed for the chart. |
| 12684 | subtitle - The subtitle displayed for the chart. |
| 12685 | data_name - The series name. Useful for multi-series charts. |
| 12686 | If no data_name, will default to using "Series 1". |
| 12687 | unit - The description label given to the chart's y-axis values. |
| 12688 | libs - The option to include Chart libraries (JS and CSS files). |
| 12689 | Should be set to True (default) for the first time creating |
| 12690 | a chart on a web page. If creating multiple charts on the |
| 12691 | same web page, you won't need to re-import the libraries |
| 12692 | when creating additional charts. |
| 12693 | labels - If True, displays labels on the chart for data points. |
| 12694 | legend - If True, displays the data point legend on the chart.""" |
| 12695 | if not chart_name: |
| 12696 | chart_name = "default" |
| 12697 | if not data_name: |
| 12698 | data_name = "" |
| 12699 | style = "pie" |
| 12700 | self.__create_highchart( |
| 12701 | chart_name=chart_name, |
| 12702 | title=title, |
| 12703 | subtitle=subtitle, |
| 12704 | style=style, |
| 12705 | data_name=data_name, |
| 12706 | unit=unit, |
| 12707 | libs=libs, |
| 12708 | labels=labels, |
| 12709 | legend=legend, |
| 12710 | ) |
| 12711 | |
| 12712 | def create_bar_chart( |
| 12713 | self, |