Documentation ¶
Index ¶
- Constants
- Variables
- func Description() map[string]types.FunctionDescription
- func EvalExprGraph(ctx context.Context, e parser.Expr, from, until int32, ...) ([]*types.MetricData, error)
- func MarshalPNG(params PictureParams, results []*types.MetricData) ([]byte, error)
- func MarshalPNGRequest(r *http.Request, results []*types.MetricData, templateName string) ([]byte, error)
- func MarshalPNGRequestErr(r *http.Request, errStr string, templateName string) ([]byte, error)
- func MarshalSVG(params PictureParams, results []*types.MetricData) ([]byte, error)
- func MarshalSVGRequest(r *http.Request, results []*types.MetricData, templateName string) ([]byte, error)
- func SetColor(name, rgba string) error
- func SetTemplate(name string, params PictureParams)
- type AreaMode
- type FontSlant
- type FontWeight
- type LineMode
- type PictureParams
- type PieMode
- type YAxisSide
Constants ¶
View Source
const HaveGraphSupport = false
Variables ¶
View Source
var DefaultColorList = []string{"blue", "green", "red", "purple", "brown", "yellow", "aqua", "grey", "magenta", "pink", "gold", "rose"}
View Source
var DefaultParams = PictureParams{ Width: 330, Height: 250, Margin: 10, LogBase: 0, FgColor: "white", BgColor: "black", MajorLine: "rose", MinorLine: "grey", FontName: "Sans", FontSize: 10, FontBold: FontWeightNormal, FontItalic: FontSlantNormal, GraphOnly: false, HideLegend: false, HideGrid: false, HideAxes: false, HideYAxis: false, HideXAxis: false, YAxisSide: YAxisSideLeft, Title: "", Vtitle: "", VtitleRight: "", Tz: time.Local, ConnectedLimit: math.MaxInt32, LineMode: LineModeSlope, AreaMode: AreaModeNone, AreaAlpha: math.NaN(), PieMode: PieModeAverage, LineWidth: 1.2, ColorList: DefaultColorList, YMin: math.NaN(), YMax: math.NaN(), YStep: math.NaN(), XMin: math.NaN(), XMax: math.NaN(), XStep: math.NaN(), XFormat: "", MinorY: 1, UniqueLegend: false, DrawNullAsZero: false, DrawAsInfinite: false, YMinLeft: math.NaN(), YMinRight: math.NaN(), YMaxLeft: math.NaN(), YMaxRight: math.NaN(), YStepL: math.NaN(), YStepR: math.NaN(), YLimitLeft: math.NaN(), YLimitRight: math.NaN(), YUnitSystem: "si", YDivisors: []float64{4, 5, 6}, RightWidth: 1.2, RightDashed: false, RightColor: "", LeftWidth: 1.2, LeftDashed: false, LeftColor: "", MajorGridLineColor: "white", MinorGridLineColor: "grey", }
Functions ¶
func Description ¶
func Description() map[string]types.FunctionDescription
func EvalExprGraph ¶
func EvalExprGraph(ctx context.Context, e parser.Expr, from, until int32, values map[parser.MetricRequest][]*types.MetricData, getTargetData interfaces.GetTargetData) ([]*types.MetricData, error)
func MarshalPNG ¶
func MarshalPNG(params PictureParams, results []*types.MetricData) ([]byte, error)
func MarshalPNGRequest ¶
func MarshalPNGRequestErr ¶ added in v0.2.0
func MarshalSVG ¶
func MarshalSVG(params PictureParams, results []*types.MetricData) ([]byte, error)
func MarshalSVGRequest ¶
func SetTemplate ¶
func SetTemplate(name string, params PictureParams)
SetTemplate adds a picture param template with specified name and parameters
Types ¶
type PictureParams ¶
type PictureParams struct { PixelRatio float64 Width float64 Height float64 Margin int LogBase float64 FgColor string BgColor string MajorLine string MinorLine string FontName string FontSize float64 FontBold FontWeight FontItalic FontSlant GraphOnly bool HideLegend bool HideGrid bool HideAxes bool HideYAxis bool HideXAxis bool YAxisSide YAxisSide Title string Vtitle string VtitleRight string Tz *time.Location ConnectedLimit int LineMode LineMode AreaMode AreaMode AreaAlpha float64 PieMode PieMode LineWidth float64 ColorList []string YMin float64 YMax float64 XMin float64 XMax float64 YStep float64 XStep float64 MinorY int XFormat string YMaxLeft float64 YLimitLeft float64 YMaxRight float64 YLimitRight float64 YMinLeft float64 YMinRight float64 YStepL float64 YStepR float64 UniqueLegend bool DrawNullAsZero bool DrawAsInfinite bool YUnitSystem string YDivisors []float64 RightWidth float64 RightDashed bool RightColor string LeftWidth float64 LeftDashed bool LeftColor string MinorGridLineColor string MajorGridLineColor string }
func GetPictureParams ¶
func GetPictureParams(r *http.Request, metricData []*types.MetricData) PictureParams
GetPictureParams returns PictureParams with default settings
func GetPictureParamsWithTemplate ¶
func GetPictureParamsWithTemplate(r *http.Request, template string, metricData []*types.MetricData) PictureParams
GetPictureParamsWithTemplate returns PictureParams with specified template
Click to show internal directories.
Click to hide internal directories.