Skip to content

rubiojr/echarts-risor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Echarts

Risor module to create charts. Wraps https://github.com/go-echarts/go-echarts.

Note

This module is not included with Risor.

The echarts module exposes a simple interface to create charts, powered by the great go-echarts library.

Functions

bar

bar(file string, data map, opts map)

Creates a new bar chart.

data := {
  "serie A": [1, 2, 3],
  "serie B": [3, 4, 5],
}

echarts.bar(
	"bar.html",
	data,
)

The opts argument may be a map containing any of the following keys:

Name Type Description
title string The title of the chart
subtitle string The subtitle of the chart
xlabels []string The labels for the x-axis
data := {
  "serie A": [1, 2, 3],
  "serie B": [3, 4, 5],
}

echarts.bar(
	"bar.html",
	data,
	{
		title: "My awesome bar chart",
		subtitle: "this is a subtitle",
		xlabels: ["one", "two", "three"]
	},
)

line

line(file string, data map, opts map)

Creates a new line chart.

data := {
  "serie A": [1, 2, 3],
  "serie B": [3, 4, 5],
}

echarts.line(
	"line.html",
	data,
)

The opts argument may be a map containing any of the following keys:

Name Type Description
title string The title of the chart
subtitle string The subtitle of the chart
xlabels []string The labels for the x-axis
data := {
  "serie A": [1, 2, 3],
  "serie B": [3, 4, 5],
}

echarts.line(
	"line.html",
	data,
	{
		title: "My awesome line chart",
		subtitle: "this is a subtitle",
		xlabels: ["one", "two", "three"]
	},
)

About

Data visualization module for Risor

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages