Versions in this module Expand all Collapse all v0 v0.1.6 May 12, 2024 Changes in this version type BarChartOption + RoundedBarCaps *bool v0.1.5 Mar 9, 2024 Changes in this version + func NewSector(cx int, cy int, radius float64, labelRadius float64, value float64, ...) sector v0.1.4 Feb 15, 2024 v0.1.3 Feb 15, 2024 v0.1.2 Feb 15, 2024 Changes in this version type AxisOption + LabelCountAdjustment int type XAxisOption + LabelCountAdjustment int type YAxisOption + LabelCountAdjustment int v0.1.1 Feb 14, 2024 Changes in this version + type Offset struct + Left int + Top int v0.1.0 Feb 12, 2024 Changes in this version + const AlignCenter + const AlignLeft + const AlignRight + const ChartOutputPNG + const ChartOutputSVG + const ChartTypeBar + const ChartTypeFunnel + const ChartTypeHorizontalBar + const ChartTypeLine + const ChartTypePie + const ChartTypeRadar + const G_VALUE + const IconLineDot + const IconRect + const K_VALUE + const M_VALUE + const OrientHorizontal + const OrientVertical + const PositionBottom + const PositionCenter + const PositionLeft + const PositionRight + const PositionTop + const SeriesMarkDataTypeAverage + const SeriesMarkDataTypeMax + const SeriesMarkDataTypeMin + const T_VALUE + const ThemeAnt + const ThemeDark + const ThemeGrafana + const ThemeLight + const ThemeVividDark + const ThemeVividLight + var BoxZero = chart.BoxZero + var TableDarkThemeSetting = TableSetting + var TableLightThemeSetting = TableSetting + func BoolPointer(b bool) *bool + func False() *bool + func FloatPointer(f float64) *float64 + func GetDefaultFont() *truetype.Font + func GetFont(fontFamily string) *truetype.Font + func GetNullValue() float64 + func InstallFont(fontFamily string, data []byte) error + func InstallTheme(name string, opt ThemeOption) + func NewAxisPainter(p *Painter, opt AxisOption) *axisPainter + func NewBarChart(p *Painter, opt BarChartOption) *barChart + func NewBottomXAxis(p *Painter, opt XAxisOption) *axisPainter + func NewFunnelChart(p *Painter, opt FunnelChartOption) *funnelChart + func NewGridPainter(p *Painter, opt GridPainterOption) *gridPainter + func NewHorizontalBarChart(p *Painter, opt HorizontalBarChartOption) *horizontalBarChart + func NewLeftYAxis(p *Painter, opt YAxisOption) *axisPainter + func NewLegendPainter(p *Painter, opt LegendOption) *legendPainter + func NewLineChart(p *Painter, opt LineChartOption) *lineChart + func NewMarkLinePainter(p *Painter) *markLinePainter + func NewMarkPointPainter(p *Painter) *markPointPainter + func NewPieChart(p *Painter, opt PieChartOption) *pieChart + func NewRadarChart(p *Painter, opt RadarChartOption) *radarChart + func NewRange(painter *Painter, size, divideCount int, ...) axisRange + func NewRightYAxis(p *Painter, opt YAxisOption) *axisPainter + func NewTableChart(p *Painter, opt TableChartOption) *tableChart + func NewTitlePainter(p *Painter, opt TitleOption) *titlePainter + func RenderEChartsToPNG(options string) ([]byte, error) + func RenderEChartsToSVG(options string) ([]byte, error) + func SetDefaultFont(fontFamily string) error + func SetDefaultHeight(height int) + func SetDefaultTheme(name string) error + func SetDefaultWidth(width int) + func SetNullValue(v float64) + func True() *bool + type AxisOption struct + BoundaryGap *bool + Data []string + DataStartIndex int + Font *truetype.Font + FontColor Color + FontSize float64 + Formatter string + LabelCount int + LabelMargin int + LabelOffset Box + LabelSkipCount int + Position string + Show *bool + SplitLineShow bool + StrokeWidth float64 + TextRotation float64 + Theme ColorPalette + TickLength int + Unit float64 + type BarChartOption struct + BarWidth int + Font *truetype.Font + Legend LegendOption + Padding Box + SeriesList SeriesList + Theme ColorPalette + Title TitleOption + XAxis XAxisOption + YAxis []YAxisOption + type Box = chart.Box + type ChartOption struct + BarHeight int + BarWidth int + Box Box + Children []ChartOption + FillArea bool + FillOpacity uint8 + Font *truetype.Font + Height int + Legend LegendOption + LineStrokeWidth float64 + OutputFormat string + Padding Box + Parent *Painter + RadarIndicators []RadarIndicator + SeriesList SeriesList + SymbolShow *bool + Theme ColorPalette + Title TitleOption + ValueFormatter ValueFormatter + Width int + XAxis XAxisOption + YAxis []YAxisOption + type Color = drawing.Color + type ColorPalette interface + GetAxisSplitLineColor func() Color + GetAxisStrokeColor func() Color + GetBackgroundColor func() Color + GetSeriesColor func(int) Color + GetTextColor func() Color + IsDark func() bool + WithAxisColor func(Color) ColorPalette + WithTextColor func(Color) ColorPalette + func GetDefaultTheme() ColorPalette + func GetTheme(name string) ColorPalette + func MakeTheme(opt ThemeOption) ColorPalette + type EChartStyle struct + Color string + func (es *EChartStyle) ToStyle() Style + type EChartsAxisLabel struct + Formatter string + type EChartsLabelOption struct + Color string + Distance int + Show bool + type EChartsLegend struct + Align string + Data []string + Left EChartsPosition + Orient string + Padding EChartsPadding + Show *bool + TextStyle EChartsTextStyle + Top EChartsPosition + type EChartsMarkData struct + Type string + func (emd *EChartsMarkData) UnmarshalJSON(data []byte) error + type EChartsMarkLine struct + Data []EChartsMarkData + func (eml *EChartsMarkLine) ToSeriesMarkLine() SeriesMarkLine + type EChartsMarkPoint struct + Data []EChartsMarkData + SymbolSize int + func (emp *EChartsMarkPoint) ToSeriesMarkPoint() SeriesMarkPoint + type EChartsOption struct + Box chart.Box + Children []EChartsOption + FontFamily string + Height int + Legend EChartsLegend + Padding EChartsPadding + Radar struct{ ... } + Series EChartsSeriesList + Theme string + Title struct{ ... } + Type string + Width int + XAxis EChartsXAxis + YAxis EChartsYAxis + func (eo *EChartsOption) ToOption() ChartOption + type EChartsPadding struct + Box chart.Box + func (eb *EChartsPadding) UnmarshalJSON(data []byte) error + type EChartsPosition string + func (p *EChartsPosition) UnmarshalJSON(data []byte) error + type EChartsSeries struct + Data []EChartsSeriesData + ItemStyle EChartStyle + Label EChartsLabelOption + MarkLine EChartsMarkLine + MarkPoint EChartsMarkPoint + Max *float64 + Min *float64 + Name string + Radius string + Type string + YAxisIndex int + type EChartsSeriesData struct + ItemStyle EChartStyle + Name string + Value EChartsSeriesDataValue + func (es *EChartsSeriesData) UnmarshalJSON(data []byte) error + type EChartsSeriesDataValue struct + func NewEChartsSeriesDataValue(values ...float64) EChartsSeriesDataValue + func (value *EChartsSeriesDataValue) First() float64 + func (value *EChartsSeriesDataValue) UnmarshalJSON(data []byte) error + type EChartsSeriesList []EChartsSeries + func (esList EChartsSeriesList) ToSeriesList() SeriesList + type EChartsTextStyle struct + Color string + FontFamily string + FontSize float64 + func (et *EChartsTextStyle) ToStyle() chart.Style + type EChartsXAxis struct + Data []EChartsXAxisData + func (ex *EChartsXAxis) UnmarshalJSON(data []byte) error + type EChartsXAxisData struct + BoundaryGap *bool + Data []string + SplitNumber int + Type string + type EChartsYAxis struct + Data []EChartsYAxisData + func (ey *EChartsYAxis) UnmarshalJSON(data []byte) error + type EChartsYAxisData struct + AxisLabel EChartsAxisLabel + AxisLine struct{ ... } + Data []string + Max *float64 + Min *float64 + type FunnelChartOption struct + Font *truetype.Font + Legend LegendOption + Padding Box + SeriesList SeriesList + Theme ColorPalette + Title TitleOption + type GridOption struct + ColumnSpans []int + Columns int + IgnoreColumnLines []int + IgnoreRowLines []int + Rows int + type GridPainterOption struct + ColumnSpans []int + Columns int + IgnoreFirstColumn bool + IgnoreFirstRow bool + IgnoreLastColumn bool + IgnoreLastRow bool + Rows int + StrokeColor Color + StrokeWidth float64 + type HorizontalBarChartOption struct + BarHeight int + Font *truetype.Font + Legend LegendOption + Padding Box + SeriesList SeriesList + Theme ColorPalette + Title TitleOption + XAxis XAxisOption + YAxis []YAxisOption + type LabelFormatter func(index int, value float64, percent float64) string + func NewFunnelLabelFormatter(seriesNames []string, layout string) LabelFormatter + func NewLabelFormatter(seriesNames []string, layout string) LabelFormatter + func NewPieLabelFormatter(seriesNames []string, layout string) LabelFormatter + func NewValueLabelFormatter(seriesNames []string, layout string) LabelFormatter + type LabelValue struct + FontColor Color + FontSize float64 + Index int + Offset Box + Orient string + Radians float64 + Value float64 + X int + Y int + type LegendOption struct + Align string + Data []string + Font *truetype.Font + FontColor Color + FontSize float64 + Icon string + Left string + Orient string + Padding Box + Show *bool + Theme ColorPalette + Top string + func NewLegendOption(labels []string, left ...string) LegendOption + func (opt *LegendOption) IsEmpty() bool + type LineChartOption struct + FillArea bool + FillOpacity uint8 + Font *truetype.Font + Legend LegendOption + Padding Box + SeriesList SeriesList + StrokeWidth float64 + SymbolShow *bool + Theme ColorPalette + Title TitleOption + XAxis XAxisOption + YAxis []YAxisOption + type MultiTextOption struct + Align string + CenterLabels bool + First int + LabelCount int + LabelSkipCount int + Offset Box + Orient string + TextList []string + TextRotation float64 + type OptionFunc func(opt *ChartOption) + func BoxOptionFunc(box Box) OptionFunc + func ChildOptionFunc(child ...ChartOption) OptionFunc + func FontOptionFunc(font *truetype.Font) OptionFunc + func HeightOptionFunc(height int) OptionFunc + func LegendLabelsOptionFunc(labels []string, left ...string) OptionFunc + func LegendOptionFunc(legend LegendOption) OptionFunc + func MarkLineOptionFunc(seriesIndex int, markLineTypes ...string) OptionFunc + func MarkPointOptionFunc(seriesIndex int, markPointTypes ...string) OptionFunc + func OutputFormatOptionFunc(t string) OptionFunc + func PNGOutputOption() OptionFunc + func PaddingOptionFunc(padding Box) OptionFunc + func PieSeriesShowLabel() OptionFunc + func RadarIndicatorOptionFunc(names []string, values []float64) OptionFunc + func SVGOutputOption() OptionFunc + func ThemeNameOptionFunc(theme string) OptionFunc + func ThemeOptionFunc(theme ColorPalette) OptionFunc + func TitleOptionFunc(title TitleOption) OptionFunc + func TitleTextOptionFunc(text string, subtext ...string) OptionFunc + func WidthOptionFunc(width int) OptionFunc + func XAxisDataOptionFunc(data []string, boundaryGap ...*bool) OptionFunc + func XAxisOptionFunc(xAxisOption XAxisOption) OptionFunc + func YAxisDataOptionFunc(data []string) OptionFunc + func YAxisOptionFunc(yAxisOption ...YAxisOption) OptionFunc + type Painter struct + func BarRender(values [][]float64, opts ...OptionFunc) (*Painter, error) + func FunnelRender(values []float64, opts ...OptionFunc) (*Painter, error) + func HorizontalBarRender(values [][]float64, opts ...OptionFunc) (*Painter, error) + func LineRender(values [][]float64, opts ...OptionFunc) (*Painter, error) + func NewPainter(opts PainterOptions, opt ...PainterOption) (*Painter, error) + func PieRender(values []float64, opts ...OptionFunc) (*Painter, error) + func RadarRender(values [][]float64, opts ...OptionFunc) (*Painter, error) + func Render(opt ChartOption, opts ...OptionFunc) (*Painter, error) + func TableOptionRender(opt TableChartOption) (*Painter, error) + func TableRender(header []string, data [][]string, spanMaps ...map[int]int) (*Painter, error) + func (p *Painter) ArcTo(cx, cy int, rx, ry, startAngle, delta float64) *Painter + func (p *Painter) ArrowBottom(x, y, width, height int) *Painter + func (p *Painter) ArrowLeft(x, y, width, height int) *Painter + func (p *Painter) ArrowRight(x, y, width, height int) *Painter + func (p *Painter) ArrowTop(x, y, width, height int) *Painter + func (p *Painter) Bytes() ([]byte, error) + func (p *Painter) Child(opt ...PainterOption) *Painter + func (p *Painter) Circle(radius float64, x, y int) *Painter + func (p *Painter) ClearTextRotation() + func (p *Painter) Close() *Painter + func (p *Painter) Dots(points []Point) *Painter + func (p *Painter) Fill() *Painter + func (p *Painter) FillArea(points []Point) *Painter + func (p *Painter) FillStroke() *Painter + func (p *Painter) Grid(opt GridOption) *Painter + func (p *Painter) Height() int + func (p *Painter) LegendLineDot(box Box) *Painter + func (p *Painter) LineStroke(points []Point) *Painter + func (p *Painter) LineTo(x, y int) *Painter + func (p *Painter) MarkLine(x, y, width int) *Painter + func (p *Painter) MeasureText(text string) Box + func (p *Painter) MeasureTextMaxWidthHeight(textList []string) (int, int) + func (p *Painter) MoveTo(x, y int) *Painter + func (p *Painter) MultiText(opt MultiTextOption) *Painter + func (p *Painter) OverrideDrawingStyle(style Style) *Painter + func (p *Painter) OverrideTextStyle(style Style) *Painter + func (p *Painter) Pin(x, y, width int) *Painter + func (p *Painter) Polygon(center Point, radius float64, sides int) *Painter + func (p *Painter) QuadCurveTo(cx, cy, x, y int) *Painter + func (p *Painter) Rect(box Box) *Painter + func (p *Painter) ResetStyle() *Painter + func (p *Painter) SetBackground(width, height int, color Color, inside ...bool) *Painter + func (p *Painter) SetDrawingStyle(style Style) *Painter + func (p *Painter) SetStyle(style Style) + func (p *Painter) SetTextRotation(radians float64) + func (p *Painter) SetTextStyle(style Style) *Painter + func (p *Painter) SmoothLineStroke(points []Point) *Painter + func (p *Painter) Stroke() *Painter + func (p *Painter) Text(body string, x, y int) *Painter + func (p *Painter) TextFit(body string, x, y, width int, textAligns ...string) chart.Box + func (p *Painter) TextRotation(body string, x, y int, radians float64) + func (p *Painter) Ticks(opt TicksOption) *Painter + func (p *Painter) Width() int + type PainterOption func(*Painter) + func PainterBoxOption(box Box) PainterOption + func PainterFontOption(font *truetype.Font) PainterOption + func PainterPaddingOption(padding Box) PainterOption + func PainterStyleOption(style Style) PainterOption + func PainterThemeOption(theme ColorPalette) PainterOption + func PainterWidthHeightOption(width, height int) PainterOption + type PainterOptions struct + Font *truetype.Font + Height int + OutputFormat string + Width int + type PieChartOption struct + Font *truetype.Font + Legend LegendOption + Padding Box + SeriesList SeriesList + Theme ColorPalette + Title TitleOption + type PieSeriesOption struct + Label SeriesLabel + Names []string + Radius string + type Point struct + X int + Y int + type RadarChartOption struct + Font *truetype.Font + Legend LegendOption + Padding Box + RadarIndicators []RadarIndicator + SeriesList SeriesList + Theme ColorPalette + Title TitleOption + type RadarIndicator struct + Max float64 + Min float64 + Name string + func NewRadarIndicators(names []string, values []float64) []RadarIndicator + type Renderer interface + Render func() (Box, error) + type Series struct + Data []SeriesData + Label SeriesLabel + MarkLine SeriesMarkLine + MarkPoint SeriesMarkPoint + Max *float64 + Min *float64 + Name string + Radius string + Style chart.Style + Type string + YAxisIndex int + func NewSeriesFromValues(values []float64, chartType ...string) Series + func (s *Series) Summary() seriesSummary + type SeriesData struct + Style Style + Value float64 + func NewSeriesDataFromValues(values []float64) []SeriesData + type SeriesLabel struct + Color Color + Distance int + FontSize float64 + Formatter string + Offset Box + Position string + Show bool + type SeriesLabelPainter struct + func NewSeriesLabelPainter(params SeriesLabelPainterParams) *SeriesLabelPainter + func (o *SeriesLabelPainter) Add(value LabelValue) + func (o *SeriesLabelPainter) Render() (Box, error) + type SeriesLabelPainterParams struct + Font *truetype.Font + Label SeriesLabel + P *Painter + SeriesNames []string + Theme ColorPalette + type SeriesList []Series + func NewFunnelSeriesList(values []float64) SeriesList + func NewPieSeriesList(values []float64, opts ...PieSeriesOption) SeriesList + func NewSeriesListDataFromValues(values [][]float64, chartType ...string) SeriesList + func (sl SeriesList) Filter(chartType string) SeriesList + func (sl SeriesList) GetMinMax(axisIndex int) (float64, float64) + func (sl SeriesList) Names() []string + type SeriesMarkData struct + Type string + type SeriesMarkLine struct + Data []SeriesMarkData + func NewMarkLine(markLineTypes ...string) SeriesMarkLine + type SeriesMarkPoint struct + Data []SeriesMarkData + SymbolSize int + func NewMarkPoint(markPointTypes ...string) SeriesMarkPoint + type Style = chart.Style + type TableCell struct + Column int + Row int + Style Style + Text string + type TableChartOption struct + BackgroundColor Color + CellStyle func(TableCell) *Style + CellTextStyle func(TableCell) *Style + Data [][]string + Font *truetype.Font + FontColor Color + FontSize float64 + Header []string + HeaderBackgroundColor Color + HeaderFontColor Color + OutputFormat string + Padding Box + RowBackgroundColors []Color + Spans []int + TextAligns []string + Theme ColorPalette + Width int + type TableSetting struct + CellPadding Box + FontColor Color + HeaderColor Color + HeaderFontColor Color + RowColors []Color + type ThemeOption struct + AxisSplitLineColor Color + AxisStrokeColor Color + BackgroundColor Color + IsDarkMode bool + SeriesColors []Color + TextColor Color + type TicksOption struct + First int + LabelCount int + Length int + Orient string + TickSpaces int + type TitleOption struct + Font *truetype.Font + FontColor Color + FontSize float64 + Left string + Show *bool + Subtext string + SubtextFontColor Color + SubtextFontSize float64 + Text string + Theme ColorPalette + Top string + type ValueFormatter func(float64) string + type XAxisOption struct + BoundaryGap *bool + Data []string + DataStartIndex int + Font *truetype.Font + FontColor Color + FontSize float64 + LabelCount int + LabelOffset Box + Position string + Show *bool + TextRotation float64 + Theme ColorPalette + Unit float64 + func NewXAxisOption(data []string, boundaryGap ...*bool) XAxisOption + func (opt *XAxisOption) ToAxisOption() AxisOption + type YAxisOption struct + AxisColor Color + Data []string + Font *truetype.Font + FontColor Color + FontSize float64 + Formatter string + LabelCount int + LabelSkipCount int + Max *float64 + Min *float64 + Position string + RangeValuePaddingScale *float64 + Show *bool + SplitLineShow *bool + Theme ColorPalette + Unit float64 + func NewYAxisOptions(data []string, others ...[]string) []YAxisOption + func (opt *YAxisOption) ToAxisOption(p *Painter) AxisOption