chartit.templatetags package¶
Submodules¶
chartit.templatetags.chartit module¶
Loads the
Chart
/PivotChart
objects in thechart_list
to the HTML elements with id’s specified inrender_to
.Arguments: chart_list - a list of Chart/PivotChart objects. If there is just a single element, the Chart/PivotChart object can be passed directly instead of a list with a single element.
render_to - a comma separated string of HTML element id’s where the charts needs to be rendered to. If the element id of a specific chart is already defined during the chart creation, the
render_to
for that specific chart can be an empty string or a space.For example,
render_to = 'container1, , container3'
renders three charts to three locations in the HTML page. The first one will be rendered in the HTML element with idcontainer1
, the second one to it’s default location that was specified inchart_options
when the Chart/PivotChart object was created, and the third one in the element with idcontainer3
.
Returns: - a JSON array of the HighCharts Chart options. Also returns a link
to the
chartloader.js
javascript file to be embedded in the webpage. Thechartloader.js
has a jQuery script that renders a HighChart for each of the options in the JSON array