Creates a JavaScript bar 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,
)
| 12710 | ) |
| 12711 | |
| 12712 | def create_bar_chart( |
| 12713 | self, |
| 12714 | chart_name=None, |
| 12715 | title=None, |
| 12716 | subtitle=None, |
| 12717 | data_name=None, |
| 12718 | unit=None, |
| 12719 | libs=True, |
| 12720 | labels=True, |
| 12721 | legend=True, |
| 12722 | ): |
| 12723 | """Creates a JavaScript bar chart using "HighCharts". |
| 12724 | @Params |
| 12725 | chart_name - If creating multiple charts, |
| 12726 | use this to select which one. |
| 12727 | title - The title displayed for the chart. |
| 12728 | subtitle - The subtitle displayed for the chart. |
| 12729 | data_name - The series name. Useful for multi-series charts. |
| 12730 | If no data_name, will default to using "Series 1". |
| 12731 | unit - The description label given to the chart's y-axis values. |
| 12732 | libs - The option to include Chart libraries (JS and CSS files). |
| 12733 | Should be set to True (default) for the first time creating |
| 12734 | a chart on a web page. If creating multiple charts on the |
| 12735 | same web page, you won't need to re-import the libraries |
| 12736 | when creating additional charts. |
| 12737 | labels - If True, displays labels on the chart for data points. |
| 12738 | legend - If True, displays the data point legend on the chart.""" |
| 12739 | if not chart_name: |
| 12740 | chart_name = "default" |
| 12741 | if not data_name: |
| 12742 | data_name = "" |
| 12743 | style = "bar" |
| 12744 | self.__create_highchart( |
| 12745 | chart_name=chart_name, |
| 12746 | title=title, |
| 12747 | subtitle=subtitle, |
| 12748 | style=style, |
| 12749 | data_name=data_name, |
| 12750 | unit=unit, |
| 12751 | libs=libs, |
| 12752 | labels=labels, |
| 12753 | legend=legend, |
| 12754 | ) |
| 12755 | |
| 12756 | def create_column_chart( |
| 12757 | self, |