c3
package v2.26.5
Go to latest Published: Nov 23, 2025 License:MIT
Opens a new window with list of versions in this module.
Latest LatestThis package is not in the latest version of its module.
Opens a new window with license information.
Imports:8 Opens a new window with list of imports.
Imported by:1 Opens a new window with list of known importers.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
README¶
C3 Examples
These examples use Go code to create examples similar to the official C3 JS samples.
Examples
References
- https://c3js.org/samples/data_label.html
- https://c3js.org/samples/data_label_format.html
- https://c3js.org/samples/categorized.html (Supported)
- https://c3js.org/samples/grid_y_lines.html (Not Supported)
- https://codepen.io/rjlinden/pen/AzvJq
- https://blog.trifork.com/2014/07/29/creating-charts-with-c3-js/
- https://github.com/c3js/c3/issues/2084
Documentation¶
Index¶
- Constants
- func C3BarChartJS(chart C3Chart) string
- func C3ChartHTMLSimple(id string, chart C3Chart) string
- func C3DonutChartPage(data TemplateData) string
- func StreamC3BarChartJS(qw422016 *qt422016.Writer, chart C3Chart)
- func StreamC3ChartHTMLSimple(qw422016 *qt422016.Writer, id string, chart C3Chart)
- func StreamC3DonutChartPage(qw422016 *qt422016.Writer, data TemplateData)
- func StreamTimeseriesHTML(qw422016 *qt422016.Writer, data TimeseriesData)
- func StreamTimeseriesPage(qw422016 *qt422016.Writer, pageData TimeseriesPageData)
- func TimeseriesHTML(data TimeseriesData) string
- func TimeseriesPage(pageData TimeseriesPageData) string
- func WriteC3BarChartJS(qq422016 qtio422016.Writer, chart C3Chart)
- func WriteC3ChartHTMLSimple(qq422016 qtio422016.Writer, id string, chart C3Chart)
- func WriteC3DonutChartPage(qq422016 qtio422016.Writer, data TemplateData)
- func WriteTimeseriesHTML(qq422016 qtio422016.Writer, data TimeseriesData)
- func WriteTimeseriesPage(qq422016 qtio422016.Writer, pageData TimeseriesPageData)
- type C3Axis
- type C3AxisX
- type C3Bar
- type C3Chart
- type C3ChartData
- type C3ColumnInt
- type C3ColumnsInt
- type C3Donut
- type C3Grid
- type C3GridLine
- type C3GridLines
- type TemplateData
- type TimeseriesData
- type TimeseriesDataJSON
- type TimeseriesPageData
Constants¶
View Source
const (ChartTypeBar = "bar")Variables¶
This section is empty.
Functions¶
funcC3BarChartJS¶
funcC3DonutChartPage¶
func C3DonutChartPage(dataTemplateData)string
funcStreamC3DonutChartPage¶
func StreamC3DonutChartPage(qw422016 *qt422016.Writer, dataTemplateData)
funcStreamTimeseriesHTML¶
func StreamTimeseriesHTML(qw422016 *qt422016.Writer, dataTimeseriesData)
funcStreamTimeseriesPage¶
func StreamTimeseriesPage(qw422016 *qt422016.Writer, pageDataTimeseriesPageData)
funcTimeseriesHTML¶
func TimeseriesHTML(dataTimeseriesData)string
funcTimeseriesPage¶
func TimeseriesPage(pageDataTimeseriesPageData)string
funcWriteC3BarChartJS¶
func WriteC3BarChartJS(qq422016qtio422016.Writer, chartC3Chart)
funcWriteC3ChartHTMLSimple¶
func WriteC3ChartHTMLSimple(qq422016qtio422016.Writer, idstring, chartC3Chart)
funcWriteC3DonutChartPage¶
func WriteC3DonutChartPage(qq422016qtio422016.Writer, dataTemplateData)
funcWriteTimeseriesHTML¶
func WriteTimeseriesHTML(qq422016qtio422016.Writer, dataTimeseriesData)
funcWriteTimeseriesPage¶
func WriteTimeseriesPage(qq422016qtio422016.Writer, pageDataTimeseriesPageData)
Types¶
typeC3Chart¶
type C3Chart struct {Bindtostring `json:"bindto,omitempty"`DataC3ChartData `json:"data,omitempty"`AxisC3Axis `json:"axis,omitempty"`GridC3Grid `json:"grid,omitempty"`DonutC3Donut `json:"donut,omitempty"`BarC3Bar `json:"bar,omitempty"`}funcTimeSeriesSetSimpleToC3ChartBar¶
func TimeSeriesSetSimpleToC3ChartBar(data []timeseries.RowInt64, c3BarInfoC3Bar)C3Chart
typeC3ChartData¶
type C3ChartData struct {Xstring `json:"x,omitempty"`Columns [][]any `json:"columns,omitempty"`Typestring `json:"type,omitempty"`}func (*C3ChartData)MustJSON¶
func (data *C3ChartData) MustJSON() []byte
typeC3ColumnInt¶
typeC3ColumnsInt¶
type C3ColumnsInt struct {Columns []C3ColumnInt}func (*C3ColumnsInt)ToC3ChartData¶
func (cols *C3ColumnsInt) ToC3ChartData(chartTypestring)C3ChartData
typeC3Grid¶
type C3Grid struct {XC3GridLines `json:"x,omitempty"`YC3GridLines `json:"y,omitempty"`}typeC3GridLine¶
typeC3GridLines¶
type C3GridLines struct {Showbool `json:"show,omitempty"`LinesC3GridLine `json:"lines,omitempty"`}typeTemplateData¶
type TemplateData struct {HeaderHTMLstringReportNamestringReportLinkstringIncludeDataTableboolIncludeDataTableTotalsboolC3ChartC3ChartFooterHTMLstring}func (*TemplateData)FormattedDataJSON¶
func (td *TemplateData) FormattedDataJSON() []byte
typeTimeseriesData¶
type TimeseriesData struct {IncludeTitleboolTitlestringTitleLevelstringDivIDstringJSDataVarstringJSChartVarstringTimeSeriesSet *interval.TimeSeriesSetJSONDataTimeseriesDataJSON}func (*TimeseriesData)AddTimeSeriesSet¶
func (data *TimeseriesData) AddTimeSeriesSet(set *interval.TimeSeriesSet, intervaltimeutil.Interval, seriesTypeinterval.SeriesType)error
func (*TimeseriesData)DataJSON¶
func (data *TimeseriesData) DataJSON() []byte
func (*TimeseriesData)FormattedDataJSON¶
func (data *TimeseriesData) FormattedDataJSON() []byte
typeTimeseriesDataJSON¶
type TimeseriesDataJSON struct {Columns [][]any `json:"columns"`Totals []int64 `json:"totals"`TotalsMap map[string]int64 `json:"totalsMap"`}func (*TimeseriesDataJSON)JSON¶
func (tdj *TimeseriesDataJSON) JSON() []byte
typeTimeseriesPageData¶
type TimeseriesPageData struct {TitlestringURLstringCharts []TimeseriesDataXoxinterval.YoYQoQGrowthXoxPoints []interval.XoxPoint}
Source Files¶
Directories¶
| Path | Synopsis |
|---|---|
c3sts is a package for creating C3 charts from statictimeseries data. | c3sts is a package for creating C3 charts from statictimeseries data. |
examples | |
bar_chartcommand | |
categorizedcommand | |
donut_chartcommand | |
funnel_chartcommand |
Click to show internal directories.
Click to hide internal directories.