pyxley.charts.nvd3 package¶
Submodules¶
pyxley.charts.nvd3.nvd3 module¶
-
class
pyxley.charts.nvd3.nvd3.
NVD3
(opts, api_route)¶ Bases:
pyxley.charts.charts.Chart
Base class for NVD3 Charts.
This class is used to create charts from http://nvd3.org/
pyxley.charts.nvd3.pie_chart module¶
-
class
pyxley.charts.nvd3.pie_chart.
PieChart
(values, df, init_params={}, chart_id='piechart', url='/piechart/', colors=[], label_type='percent', route_func=None)¶ Bases:
pyxley.charts.nvd3.nvd3.NVD3
NVD3 Pie Chart
Wrapper for the NVD3 pie chart implemented in PyxleyJS based on http://nvd3.org/examples/pie.html. When a route_func is supplied, the inputs are ignored in favor of the endpoint function.
Parameters: - values (dict) – labels of the pie chart.
- df (dataframe) – chart data.
- init_params (dict) – parameters used to initialize the chart.
- chart_id – html element id.
- url – name of the endpoint to be created.
- colors (list) – list of colors to show in the chart.
- label_type (str) – type of label to display.
- route_func (function) – optional endpoint function.
-
static
to_json
(df, values)¶ Format output for the json response.
pyxley.charts.nvd3.two_axis_focus module¶
-
class
pyxley.charts.nvd3.two_axis_focus.
TwoAxisFocus
(x, y1, y2, data_source, init_params={}, chart_id='new_chart', url='/new_chart/', colors=[], auto_scale='sigma', y1_axis_range=[], y2_axis_range=[], sigma=3, x_label='', y1_label='', y2_label='', margin={'top': 30, 'right': 60, 'left': 70, 'bottom': 50}, route_func=None)¶ Bases:
pyxley.charts.nvd3.nvd3.NVD3
NVD3 Two Axis Focus
Wrapper for the cross-filter chart implemented in PyxleyJS based on http://nvd3.org/examples/linePlusBar.html. When a route_func is supplied, the inputs are ignored in favor of the endpoint function.
Parameters: - values (dict) – labels of the pie chart.
- data_source (dataframe) – chart data.
- x (str) – name of the column for the x-axis.
- y1 (str) – name of the column for the primary y-axis.
- y2 (str) – name of the column for the secondary y-axis.
- init_params (dict) – parameters used to initialize the chart.
- chart_id – html element id.
- url – name of the endpoint to be created.
- colors (list) – list of colors to show in the chart.
- auto_scale (str) – select auto scale method.
- y1_axis_range (list) – range of the primary y-axis.
- y2_axis_range (list) – range of the secondary y-axis.
- x_label (str) – label of the x-axis.
- y1_label (str) – label of the primary axis.
- y2_label (str) – label of the secondary axis.
- margin (dict) – margins in pixels.
- route_func (function) – optional endpoint function.
-
static
get_bounds
(y, method='sigma', sigma=3)¶
-
static
to_json
(df, x, y1, y2, y1_axis_range, y2_axis_range, auto_scale, sigma)¶