cubes.piws.views.highcharts_views.HighChartsBasicPlotView

class cubes.piws.views.highcharts_views.HighChartsBasicPlotView(req=None, rset=None, **kwargs)[source]

Create a basic plot using highcharts.

__init__(req=None, rset=None, **kwargs)

Methods

__init__([req, rset])
call([rset, title, value_suffix, is_hist, ...]) Method that will create a basic plot from a cw resultset.
cell_call(row, col, **kwargs) the view is called for a particular result set cell
critical(msg, *args, **kwargs) Log ‘msg % args’ with severity ‘CRITICAL’.
cw_propval(propid) return cw property value associated to key
debug(msg, *args, **kwargs) Log ‘msg % args’ with severity ‘DEBUG’.
error(msg, *args, **kwargs) Log ‘msg % args’ with severity ‘ERROR’.
exception(msg, *args, **kwargs) Convenience method for logging an ERROR with exception information.
field(label, value[, row, show_label, w, ...]) read-only field
html_headers() return a list of html headers (eg something to be inserted between
info(msg, *args, **kwargs) Log ‘msg % args’ with severity ‘INFO’.
is_primary()
last_modified() return the date/time where this view should be considered as
linkable() return True if the view may be linked in a menu
page_title() returns a title according to the result set - used for the
render([w]) called to render a view object for a result set.
rset_to_hist(rset) Method that format the rset parameters for highcharts plot.
set_http_cache_headers()
set_request_content_type() set the content type returned by this view
set_stream([w])
tal_render(template, variables) render a precompiled page template with variables in the given
url() return the url associated with this view. Should not be
warning(msg, *args, **kwargs) Log ‘msg % args’ with severity ‘WARNING’.
wdata(data) simple helper that escapes data and writes into self.w
whead(data)
wview(_View__vid[, rset, _View__fallback_vid]) shortcut to self.view method automatically passing self.w as argument

Attributes

add_div_section
add_to_breadcrumbs
binary
cache_max_age
category
content_type
div_id
paginable
templatable
title
__module__ = 'cubes.piws.views.highcharts_views'
__regid__ = 'highcharts-basic-plot'
call(rset=None, title='', value_suffix='', is_hist=False, y_label='', data=None, tag='hc_container', **kwargs)[source]

Method that will create a basic plot from a cw resultset.

If no resultset are passed to this method, the current resultset is used.

Parameters:

rset: resultset (optional, default None) :

a cw resultset

title: string (optional, default None) :

the name of the chart.

value_suffix: str (optional) :

the units of what we measure.

is_hist: bool (optional, default False) :

consider the rset as an input of a simple plot or an histogram plot.

y_label: str (optional) :

the label of the y axis.

data: dict (optional, default None) :

the highcharts string representation of the data. If set, do not generate the data from the rset, so the ‘is_hist’ option has no effect.

tag: str (optional, default ‘hc_container’) :

the html div identifier.

div_id = 'highcharts-basic-plot'
paginable = False
rset_to_hist(rset)[source]

Method that format the rset parameters for highcharts plot.

We only consider the first element of each resultset row to construct the highcharts formated parameter.

Parameters:

rset: resultset (mandatory) :

a cw resultset

Returns:

sdata: string :

the highcharts formated parameter

title = u'HighCharts'