{# ------------------------------------------------------------------------------ #} {# DOUNGHNUT CHART - @see https://www.chartjs.org/docs/2.9.4/charts/doughnut.html #} {# ------------------------------------------------------------------------------ #} {# options = {'label': 'label', 'title': string|null, 'footer': string|null, 'legend': {'display': false}} #} {% macro doughnut_javascript(options) %} {% endmacro %} {# id = 'name' labels = ['Foo', 'Bar'] dataset = [{name: '', color: '', duration: 0, rate: 0}] options = {'height: '100px', 'renderEvent': 'kimai.initialized'} #} {% macro doughnut_chart(id, labels, dataset, options) %} {% set height = options.height|default(config('theme.chart.height') ~ 'px') %} {% set bgColor = config('theme.chart.background_color') %}
{% endmacro %} {# ------------------------------------------------------------------- #} {# BAR CHART - @see https://www.chartjs.org/docs/2.9.4/charts/bar.html #} {# ------------------------------------------------------------------- #} {# options = {'label': 'label', 'title': string|null, 'footer': string|null, 'legend': {'display': false}, 'onclick': {'url': string, 'replacer': {'name': 'value'}}} #} {% macro bar_javascript(options) %} {% endmacro %} {# id = 'name' labels = ['Foo', 'Bar'] datasets = [[{'value': 1234, 'tooltip': '1234€', 'color': ''}]] options = {'height: '100px', 'renderEvent': 'kimai.initialized'} #} {% macro bar_chart(id, labels, datasets, options) %} {% set height = options.height|default(config('theme.chart.height') ~ 'px') %} {% set bgColor = config('theme.chart.background_color') %}
{% endmacro %}