GraphC3 Module

class epyk.core.html.graph.GraphC3.Chart(page: PageModel, width, height, html_code, options, profile)
build(data: Union[str, JsDataModel, float, dict, list, bool] = None, options: Optional[Union[bool, dict]] = None, profile: Optional[Union[bool, dict]] = False, component_id: str = None, stop_state: bool = True, dataflows: List[dict] = None) str

Update the chart with context and / or data changes.

Parameters:
  • data – Optional. The dataset to be added to the chart

  • options – Optional. Specific Python options available for this component

  • profile – Optional. A flag to set the component performance storage

  • component_id – Optional. The component reference (the htmlCode)

  • stop_state – Remove the top panel for the component state (error, loading…)

  • dataflows – Chain of data transformations

property chartId: str

Return the Javascript variable of the chart.

click(js_funcs: Union[List[Union[str, JsDataModel]], str], profile: Optional[Union[bool, dict]] = False, source_event: Optional[str] = None, on_ready: bool = False)

Set a callback for click event on each data point.

Usage:

chart.click([page.js.console.log(chart.js.content)])

Related Pages:

Parameters:
  • js_funcs – List of Js Functions. A Javascript Python function

  • profile – Boolean. Optional. Set to true to get the profile for the function on the Javascript console

  • source_event – String. Optional. The source target for the event

  • on_ready – Boolean. Optional. Specify if the event needs to be trigger when the page is loaded

colors(hex_values: List[str])

Set the colors of the chart.

hex_values can be a list of string with the colors or a list of tuple to also set the bg colors. If the background colors are not specified they will be deduced from the colors list changing the opacity.

Parameters:

hex_values – An array of hexadecimal color codes.

property d3: D3Select

Property to the D3 library.

define(options: Optional[Union[str, JsDataModel, float, dict, list, bool]] = None, dataflows: Optional[List[dict]] = None) str
Parameters:
  • options

  • dataflows – Chain of config transformations:

property dom: C3

Return all the Javascript functions defined for an HTML Component. Those functions will use plain javascript by default.

Returns:

A Javascript Dom object.

generate(data: Union[str, JsDataModel, float, dict, list, bool], options=None, profile: Optional[Union[bool, dict]] = False, dataflows: List[dict] = None) str
Parameters:
  • data – The dataset to be added to the chart

  • options – Optional. Specific Python options available for this component

  • profile – Optional. A flag to set the component performance storage

  • dataflows – Chain of data transformations

property js: C3

JavaScript C3 reference API.

Related Pages:

Returns:

A Javascript object

property options: C3

Property to the component options. Options can either impact the Python side or the Javascript builder.

Python can pass some options to the JavaScript layer.

property shared: OptionsChartSharedC3

All the common properties shared between all the charts. This will ensure a compatibility with the plot method.

Usage:

line = page.ui.charts.c3.bar()
line.shared.x_label("x axis")
class epyk.core.html.graph.GraphC3.ChartArea(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphC3.ChartBar(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphC3.ChartDonut(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphC3.ChartGauge(page: PageModel, width, height, html_code, options, profile)
add_dataset(value: list, name: str, kind: Optional[str] = None)
Parameters:
  • value – The series of numbers to be added to the chart.

  • name – The series name.

  • kind – Optional. The chart type.

build(data: Optional[Union[str, JsDataModel, float, dict, list, bool]] = None, options: Optional[Union[bool, dict]] = None, profile: Optional[Union[bool, dict]] = False, component_id: Optional[str] = None, stop_state: bool = True) str

Update the chart with context and / or data changes.

Parameters:
  • data – Optional. The dataset to be added to the chart

  • options – Optional. Specific Python options available for this component

  • profile – Optional. A flag to set the component performance storage

  • component_id – Optional. The component reference (the htmlCode)

  • stop_state – Remove the top panel for the component state (error, loading…)

class epyk.core.html.graph.GraphC3.ChartLine(page: PageModel, width, height, html_code, options, profile)
add_dataset(data: list, name: str, kind: Optional[str] = None)

Add a new dataset.

Parameters:
  • data – The series of numbers to be added to the chart

  • name – The series name

  • kind – Optional. The chart type

labels(labels: list, series_id: str = 'x')
Parameters:
  • labels – The list of labels for the series

  • series_id – Optional. The series ID

class epyk.core.html.graph.GraphC3.ChartPie(page: PageModel, width, height, html_code, options, profile)
add_dataset(values: list, name: str, kind: Optional[str] = None)

Add a dataset to a pie chart. If multiple datasets are added the value will be summed up in the resulting pue chart.

Parameters:
  • values – The series of numbers to be added to the chart

  • name – The series name

  • kind – Optional. The chart type

labels(labels: list, series_id: str = 'x')
Parameters:
  • labels

  • series_id

class epyk.core.html.graph.GraphC3.ChartScatter(page: PageModel, width, height, html_code, options, profile)
labels(labels: list, series_id: str = 'x')
Parameters:
  • labels

  • series_id – Optional. The series ID.

class epyk.core.html.graph.GraphC3.ChartSpline(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphC3.ChartStanford(page: PageModel, width, height, html_code, options, profile)
add_dataset(data: list, name: str, kind: Optional[str] = None)
Parameters:
  • data – The series of numbers to be added to the chart

  • name – The series name

  • kind – Optional. The chart type

epoch(series: list, name: str)
Parameters:
  • series

  • name