Documentation ¶
Overview ¶
Package echarts provides a convenient rendering of [go-echarts](https://github.com/go-echarts/go-echarts) charts and plots for GoNB. It is a wrapper for [Apache ECharts](https://echarts.apache.org/en/index.html).
It defines two methods to display [go-echarts](https://github.com/go-echarts/go-echarts) charts: `Display` that immediately display the chart, and `DisplayContent` that returns the HTML content needed to generate the chart -- useful for instance if the chart needs to be laid out inside other HTML content.
See include `examples.ipynb` for examples.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Display ¶
func Display[T SupportedCharts](chart *T, style string) error
Display displays the EChart in GoNB. The parameter `style` is used for the `<div>` tag that holds the plot. Typically, one will want to set the `width` and `height`. E.g.: `style="width: 1024px; height:600px; background: white;"`.
func DisplayContent ¶ added in v0.1.0
func DisplayContent[T SupportedCharts](chart *T, style string) (html string, err error)
DisplayContent returns the HTML content (including a `<script>` tag) that displays the EChart in GoNB. One can used Display to display it directly, but if one wants to compose or change the layout, one can use this instead.
The parameter `style` is used for the `<div>` tag that holds the plot. Typically, one will want to set the `width` and `height`. E.g.: `style="width: 1024px; height:600px; background: white;"`.
Types ¶
type SupportedCharts ¶
type SupportedCharts interface { charts.Bar | charts.Bar3D | charts.BoxPlot | charts.Custom | charts.EffectScatter | charts.Funnel | charts.Gauge | charts.Geo | charts.Graph | charts.HeatMap | charts.Kline | charts.Line3D | charts.Line | charts.Liquid | charts.Map | charts.Parallel | charts.Pie | charts.Radar | charts.Sankey | charts.Scatter3D | charts.Scatter | charts.Sunburst | charts.Surface3D | charts.ThemeRiver | charts.Tree | charts.TreeMap | charts.WordCloud }