chartit.templatetags package¶
Submodules¶
chartit.templatetags.chartit module¶
Implements the {% load_charts %} template tag!
Return JSON representation of some special data types.
Loads the
Chart/PivotChartobjects in thechart_listto 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_tofor 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_optionswhen 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.jsjavascript file to be embedded in the webpage. Thechartloader.jshas a jQuery script that renders a HighChart for each of the options in the JSON array