Creates a JavaScript line 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,
zero=False,
libs=True,
labels=True,
legend=True,
)
| 12798 | ) |
| 12799 | |
| 12800 | def create_line_chart( |
| 12801 | self, |
| 12802 | chart_name=None, |
| 12803 | title=None, |
| 12804 | subtitle=None, |
| 12805 | data_name=None, |
| 12806 | unit=None, |
| 12807 | zero=False, |
| 12808 | libs=True, |
| 12809 | labels=True, |
| 12810 | legend=True, |
| 12811 | ): |
| 12812 | """Creates a JavaScript line chart using "HighCharts". |
| 12813 | @Params |
| 12814 | chart_name - If creating multiple charts, |
| 12815 | use this to select which one. |
| 12816 | title - The title displayed for the chart. |
| 12817 | subtitle - The subtitle displayed for the chart. |
| 12818 | data_name - The series name. Useful for multi-series charts. |
| 12819 | If no data_name, will default to using "Series 1". |
| 12820 | unit - The description label given to the chart's y-axis values. |
| 12821 | zero - If True, the y-axis always starts at 0. (Default: False). |
| 12822 | libs - The option to include Chart libraries (JS and CSS files). |
| 12823 | Should be set to True (default) for the first time creating |
| 12824 | a chart on a web page. If creating multiple charts on the |
| 12825 | same web page, you won't need to re-import the libraries |
| 12826 | when creating additional charts. |
| 12827 | labels - If True, displays labels on the chart for data points. |
| 12828 | legend - If True, displays the data point legend on the chart.""" |
| 12829 | if not chart_name: |
| 12830 | chart_name = "default" |
| 12831 | if not data_name: |
| 12832 | data_name = "" |
| 12833 | style = "line" |
| 12834 | self.__create_highchart( |
| 12835 | chart_name=chart_name, |
| 12836 | title=title, |
| 12837 | subtitle=subtitle, |
| 12838 | style=style, |
| 12839 | data_name=data_name, |
| 12840 | unit=unit, |
| 12841 | zero=zero, |
| 12842 | libs=libs, |
| 12843 | labels=labels, |
| 12844 | legend=legend, |
| 12845 | ) |
| 12846 | |
| 12847 | def create_area_chart( |
| 12848 | self, |