GraphFrappe Module

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

Update the chart with context and / or data changes.

Parameters:
  • data – Optional. The full datasets object expected by ChartJs

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

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

  • component_id – Not used

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

  • dataflows – Chain of data transformations

colors(hex_values: list)

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

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

Override the chart settings on the JavaScript side. This will allow ot set specific styles for some series or also add commons properties.

Usage:

chart.onReady([chart.define({“commons”: {“backgroundColor”: [“pink”], “label”: “Other series”}})])

Parameters:
  • options – JavaScript of Python attributes

  • dataflows – Chain of config transformations

property js: FrappeCharts

The Javascript functions defined for this component. Those can be specific ones for the module or generic ones from the language.

Usage:

btn = page.ui.button("Click").click([
  line.js.addDataPoint("test", [15, 67])
])
Returns:

A Javascript Dom object functions.

labels(values: list)

Set the series labels.

Parameters:

values – The different values for the x-axis

property options: FrappeLine

Chart specific options.

property shared: OptionsChartSharedFrappe

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

Usage:

line = page.ui.charts.chartJs.bar()
line.shared.x_label("x axis")
class epyk.core.html.graph.GraphFrappe.FrappeBar(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphFrappe.FrappeDonut(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphFrappe.FrappeHeatmap(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphFrappe.FrappeLine(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphFrappe.FrappePercentage(page: PageModel, width, height, html_code, options, profile)
class epyk.core.html.graph.GraphFrappe.FrappePie(page: PageModel, width, height, html_code, options, profile)