id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
25,600 | wcharczuk/go-chart | time_series.go | GetLastValues | func (ts TimeSeries) GetLastValues() (x, y float64) {
x = util.Time.ToFloat64(ts.XValues[len(ts.XValues)-1])
y = ts.YValues[len(ts.YValues)-1]
return
} | go | func (ts TimeSeries) GetLastValues() (x, y float64) {
x = util.Time.ToFloat64(ts.XValues[len(ts.XValues)-1])
y = ts.YValues[len(ts.YValues)-1]
return
} | [
"func",
"(",
"ts",
"TimeSeries",
")",
"GetLastValues",
"(",
")",
"(",
"x",
",",
"y",
"float64",
")",
"{",
"x",
"=",
"util",
".",
"Time",
".",
"ToFloat64",
"(",
"ts",
".",
"XValues",
"[",
"len",
"(",
"ts",
".",
"XValues",
")",
"-",
"1",
"]",
")"... | // GetLastValues gets the last values. | [
"GetLastValues",
"gets",
"the",
"last",
"values",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/time_series.go#L59-L63 |
25,601 | wcharczuk/go-chart | util/time.go | Millis | func (tu timeUtil) Millis(d time.Duration) float64 {
return float64(d) / float64(time.Millisecond)
} | go | func (tu timeUtil) Millis(d time.Duration) float64 {
return float64(d) / float64(time.Millisecond)
} | [
"func",
"(",
"tu",
"timeUtil",
")",
"Millis",
"(",
"d",
"time",
".",
"Duration",
")",
"float64",
"{",
"return",
"float64",
"(",
"d",
")",
"/",
"float64",
"(",
"time",
".",
"Millisecond",
")",
"\n",
"}"
] | // Millis returns the duration as milliseconds. | [
"Millis",
"returns",
"the",
"duration",
"as",
"milliseconds",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/time.go#L13-L15 |
25,602 | wcharczuk/go-chart | util/time.go | ToFloat64 | func (tu timeUtil) ToFloat64(t time.Time) float64 {
return float64(t.UnixNano())
} | go | func (tu timeUtil) ToFloat64(t time.Time) float64 {
return float64(t.UnixNano())
} | [
"func",
"(",
"tu",
"timeUtil",
")",
"ToFloat64",
"(",
"t",
"time",
".",
"Time",
")",
"float64",
"{",
"return",
"float64",
"(",
"t",
".",
"UnixNano",
"(",
")",
")",
"\n",
"}"
] | // TimeToFloat64 returns a float64 representation of a time. | [
"TimeToFloat64",
"returns",
"a",
"float64",
"representation",
"of",
"a",
"time",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/time.go#L18-L20 |
25,603 | wcharczuk/go-chart | util/time.go | FromFloat64 | func (tu timeUtil) FromFloat64(tf float64) time.Time {
return time.Unix(0, int64(tf))
} | go | func (tu timeUtil) FromFloat64(tf float64) time.Time {
return time.Unix(0, int64(tf))
} | [
"func",
"(",
"tu",
"timeUtil",
")",
"FromFloat64",
"(",
"tf",
"float64",
")",
"time",
".",
"Time",
"{",
"return",
"time",
".",
"Unix",
"(",
"0",
",",
"int64",
"(",
"tf",
")",
")",
"\n",
"}"
] | // Float64ToTime returns a time from a float64. | [
"Float64ToTime",
"returns",
"a",
"time",
"from",
"a",
"float64",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/time.go#L23-L25 |
25,604 | wcharczuk/go-chart | util/time.go | StartAndEnd | func (tu timeUtil) StartAndEnd(values ...time.Time) (start time.Time, end time.Time) {
if len(values) == 0 {
return
}
start = values[0]
end = values[0]
for _, v := range values[1:] {
if end.Before(v) {
end = v
}
if start.After(v) {
start = v
}
}
return
} | go | func (tu timeUtil) StartAndEnd(values ...time.Time) (start time.Time, end time.Time) {
if len(values) == 0 {
return
}
start = values[0]
end = values[0]
for _, v := range values[1:] {
if end.Before(v) {
end = v
}
if start.After(v) {
start = v
}
}
return
} | [
"func",
"(",
"tu",
"timeUtil",
")",
"StartAndEnd",
"(",
"values",
"...",
"time",
".",
"Time",
")",
"(",
"start",
"time",
".",
"Time",
",",
"end",
"time",
".",
"Time",
")",
"{",
"if",
"len",
"(",
"values",
")",
"==",
"0",
"{",
"return",
"\n",
"}",... | // StartAndEnd returns the start and end of a given set of time in one pass. | [
"StartAndEnd",
"returns",
"the",
"start",
"and",
"end",
"of",
"a",
"given",
"set",
"of",
"time",
"in",
"one",
"pass",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/time.go#L82-L99 |
25,605 | wcharczuk/go-chart | sma_series.go | GetPeriod | func (sma SMASeries) GetPeriod(defaults ...int) int {
if sma.Period == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return DefaultSimpleMovingAveragePeriod
}
return sma.Period
} | go | func (sma SMASeries) GetPeriod(defaults ...int) int {
if sma.Period == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return DefaultSimpleMovingAveragePeriod
}
return sma.Period
} | [
"func",
"(",
"sma",
"SMASeries",
")",
"GetPeriod",
"(",
"defaults",
"...",
"int",
")",
"int",
"{",
"if",
"sma",
".",
"Period",
"==",
"0",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"return",
"defaults",
"[",
"0",
"]",
"\n",
"}",
"\n",... | // GetPeriod returns the window size. | [
"GetPeriod",
"returns",
"the",
"window",
"size",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/sma_series.go#L52-L60 |
25,606 | wcharczuk/go-chart | style.go | StyleTextDefaults | func StyleTextDefaults() Style {
font, _ := GetDefaultFont()
return Style{
Show: true,
Font: font,
FontColor: DefaultTextColor,
FontSize: DefaultTitleFontSize,
}
} | go | func StyleTextDefaults() Style {
font, _ := GetDefaultFont()
return Style{
Show: true,
Font: font,
FontColor: DefaultTextColor,
FontSize: DefaultTitleFontSize,
}
} | [
"func",
"StyleTextDefaults",
"(",
")",
"Style",
"{",
"font",
",",
"_",
":=",
"GetDefaultFont",
"(",
")",
"\n",
"return",
"Style",
"{",
"Show",
":",
"true",
",",
"Font",
":",
"font",
",",
"FontColor",
":",
"DefaultTextColor",
",",
"FontSize",
":",
"Defaul... | // StyleTextDefaults returns a style for drawing outside a
// chart context. | [
"StyleTextDefaults",
"returns",
"a",
"style",
"for",
"drawing",
"outside",
"a",
"chart",
"context",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L27-L35 |
25,607 | wcharczuk/go-chart | style.go | IsZero | func (s Style) IsZero() bool {
return s.StrokeColor.IsZero() &&
s.StrokeWidth == 0 &&
s.DotColor.IsZero() &&
s.DotWidth == 0 &&
s.FillColor.IsZero() &&
s.FontColor.IsZero() &&
s.FontSize == 0 &&
s.Font == nil &&
s.ClassName == ""
} | go | func (s Style) IsZero() bool {
return s.StrokeColor.IsZero() &&
s.StrokeWidth == 0 &&
s.DotColor.IsZero() &&
s.DotWidth == 0 &&
s.FillColor.IsZero() &&
s.FontColor.IsZero() &&
s.FontSize == 0 &&
s.Font == nil &&
s.ClassName == ""
} | [
"func",
"(",
"s",
"Style",
")",
"IsZero",
"(",
")",
"bool",
"{",
"return",
"s",
".",
"StrokeColor",
".",
"IsZero",
"(",
")",
"&&",
"s",
".",
"StrokeWidth",
"==",
"0",
"&&",
"s",
".",
"DotColor",
".",
"IsZero",
"(",
")",
"&&",
"s",
".",
"DotWidth"... | // IsZero returns if the object is set or not. | [
"IsZero",
"returns",
"if",
"the",
"object",
"is",
"set",
"or",
"not",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L68-L78 |
25,608 | wcharczuk/go-chart | style.go | String | func (s Style) String() string {
if s.IsZero() {
return "{}"
}
var output []string
if s.Show {
output = []string{"\"show\": true"}
} else {
output = []string{"\"show\": false"}
}
if s.ClassName != "" {
output = append(output, fmt.Sprintf("\"class_name\": %s", s.ClassName))
} else {
output = append(o... | go | func (s Style) String() string {
if s.IsZero() {
return "{}"
}
var output []string
if s.Show {
output = []string{"\"show\": true"}
} else {
output = []string{"\"show\": false"}
}
if s.ClassName != "" {
output = append(output, fmt.Sprintf("\"class_name\": %s", s.ClassName))
} else {
output = append(o... | [
"func",
"(",
"s",
"Style",
")",
"String",
"(",
")",
"string",
"{",
"if",
"s",
".",
"IsZero",
"(",
")",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"output",
"[",
"]",
"string",
"\n",
"if",
"s",
".",
"Show",
"{",
"output",
"=",
"[",
"... | // String returns a text representation of the style. | [
"String",
"returns",
"a",
"text",
"representation",
"of",
"the",
"style",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L81-L165 |
25,609 | wcharczuk/go-chart | style.go | GetStrokeColor | func (s Style) GetStrokeColor(defaults ...drawing.Color) drawing.Color {
if s.StrokeColor.IsZero() {
if len(defaults) > 0 {
return defaults[0]
}
return drawing.ColorTransparent
}
return s.StrokeColor
} | go | func (s Style) GetStrokeColor(defaults ...drawing.Color) drawing.Color {
if s.StrokeColor.IsZero() {
if len(defaults) > 0 {
return defaults[0]
}
return drawing.ColorTransparent
}
return s.StrokeColor
} | [
"func",
"(",
"s",
"Style",
")",
"GetStrokeColor",
"(",
"defaults",
"...",
"drawing",
".",
"Color",
")",
"drawing",
".",
"Color",
"{",
"if",
"s",
".",
"StrokeColor",
".",
"IsZero",
"(",
")",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"re... | // GetStrokeColor returns the stroke color. | [
"GetStrokeColor",
"returns",
"the",
"stroke",
"color",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L178-L186 |
25,610 | wcharczuk/go-chart | style.go | GetFillColor | func (s Style) GetFillColor(defaults ...drawing.Color) drawing.Color {
if s.FillColor.IsZero() {
if len(defaults) > 0 {
return defaults[0]
}
return drawing.ColorTransparent
}
return s.FillColor
} | go | func (s Style) GetFillColor(defaults ...drawing.Color) drawing.Color {
if s.FillColor.IsZero() {
if len(defaults) > 0 {
return defaults[0]
}
return drawing.ColorTransparent
}
return s.FillColor
} | [
"func",
"(",
"s",
"Style",
")",
"GetFillColor",
"(",
"defaults",
"...",
"drawing",
".",
"Color",
")",
"drawing",
".",
"Color",
"{",
"if",
"s",
".",
"FillColor",
".",
"IsZero",
"(",
")",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"return... | // GetFillColor returns the fill color. | [
"GetFillColor",
"returns",
"the",
"fill",
"color",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L189-L197 |
25,611 | wcharczuk/go-chart | style.go | GetDotColor | func (s Style) GetDotColor(defaults ...drawing.Color) drawing.Color {
if s.DotColor.IsZero() {
if len(defaults) > 0 {
return defaults[0]
}
return drawing.ColorTransparent
}
return s.DotColor
} | go | func (s Style) GetDotColor(defaults ...drawing.Color) drawing.Color {
if s.DotColor.IsZero() {
if len(defaults) > 0 {
return defaults[0]
}
return drawing.ColorTransparent
}
return s.DotColor
} | [
"func",
"(",
"s",
"Style",
")",
"GetDotColor",
"(",
"defaults",
"...",
"drawing",
".",
"Color",
")",
"drawing",
".",
"Color",
"{",
"if",
"s",
".",
"DotColor",
".",
"IsZero",
"(",
")",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"return",... | // GetDotColor returns the stroke color. | [
"GetDotColor",
"returns",
"the",
"stroke",
"color",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L200-L208 |
25,612 | wcharczuk/go-chart | style.go | GetStrokeWidth | func (s Style) GetStrokeWidth(defaults ...float64) float64 {
if s.StrokeWidth == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return DefaultStrokeWidth
}
return s.StrokeWidth
} | go | func (s Style) GetStrokeWidth(defaults ...float64) float64 {
if s.StrokeWidth == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return DefaultStrokeWidth
}
return s.StrokeWidth
} | [
"func",
"(",
"s",
"Style",
")",
"GetStrokeWidth",
"(",
"defaults",
"...",
"float64",
")",
"float64",
"{",
"if",
"s",
".",
"StrokeWidth",
"==",
"0",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"return",
"defaults",
"[",
"0",
"]",
"\n",
"}... | // GetStrokeWidth returns the stroke width. | [
"GetStrokeWidth",
"returns",
"the",
"stroke",
"width",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L211-L219 |
25,613 | wcharczuk/go-chart | style.go | GetDotWidth | func (s Style) GetDotWidth(defaults ...float64) float64 {
if s.DotWidth == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return DefaultDotWidth
}
return s.DotWidth
} | go | func (s Style) GetDotWidth(defaults ...float64) float64 {
if s.DotWidth == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return DefaultDotWidth
}
return s.DotWidth
} | [
"func",
"(",
"s",
"Style",
")",
"GetDotWidth",
"(",
"defaults",
"...",
"float64",
")",
"float64",
"{",
"if",
"s",
".",
"DotWidth",
"==",
"0",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"return",
"defaults",
"[",
"0",
"]",
"\n",
"}",
"... | // GetDotWidth returns the dot width for scatter plots. | [
"GetDotWidth",
"returns",
"the",
"dot",
"width",
"for",
"scatter",
"plots",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L222-L230 |
25,614 | wcharczuk/go-chart | style.go | GetStrokeDashArray | func (s Style) GetStrokeDashArray(defaults ...[]float64) []float64 {
if len(s.StrokeDashArray) == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return nil
}
return s.StrokeDashArray
} | go | func (s Style) GetStrokeDashArray(defaults ...[]float64) []float64 {
if len(s.StrokeDashArray) == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return nil
}
return s.StrokeDashArray
} | [
"func",
"(",
"s",
"Style",
")",
"GetStrokeDashArray",
"(",
"defaults",
"...",
"[",
"]",
"float64",
")",
"[",
"]",
"float64",
"{",
"if",
"len",
"(",
"s",
".",
"StrokeDashArray",
")",
"==",
"0",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
... | // GetStrokeDashArray returns the stroke dash array. | [
"GetStrokeDashArray",
"returns",
"the",
"stroke",
"dash",
"array",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L233-L241 |
25,615 | wcharczuk/go-chart | style.go | GetFontSize | func (s Style) GetFontSize(defaults ...float64) float64 {
if s.FontSize == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return DefaultFontSize
}
return s.FontSize
} | go | func (s Style) GetFontSize(defaults ...float64) float64 {
if s.FontSize == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return DefaultFontSize
}
return s.FontSize
} | [
"func",
"(",
"s",
"Style",
")",
"GetFontSize",
"(",
"defaults",
"...",
"float64",
")",
"float64",
"{",
"if",
"s",
".",
"FontSize",
"==",
"0",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"return",
"defaults",
"[",
"0",
"]",
"\n",
"}",
"... | // GetFontSize gets the font size. | [
"GetFontSize",
"gets",
"the",
"font",
"size",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L244-L252 |
25,616 | wcharczuk/go-chart | style.go | GetFontColor | func (s Style) GetFontColor(defaults ...drawing.Color) drawing.Color {
if s.FontColor.IsZero() {
if len(defaults) > 0 {
return defaults[0]
}
return drawing.ColorTransparent
}
return s.FontColor
} | go | func (s Style) GetFontColor(defaults ...drawing.Color) drawing.Color {
if s.FontColor.IsZero() {
if len(defaults) > 0 {
return defaults[0]
}
return drawing.ColorTransparent
}
return s.FontColor
} | [
"func",
"(",
"s",
"Style",
")",
"GetFontColor",
"(",
"defaults",
"...",
"drawing",
".",
"Color",
")",
"drawing",
".",
"Color",
"{",
"if",
"s",
".",
"FontColor",
".",
"IsZero",
"(",
")",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"return... | // GetFontColor gets the font size. | [
"GetFontColor",
"gets",
"the",
"font",
"size",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L255-L263 |
25,617 | wcharczuk/go-chart | style.go | GetFont | func (s Style) GetFont(defaults ...*truetype.Font) *truetype.Font {
if s.Font == nil {
if len(defaults) > 0 {
return defaults[0]
}
return nil
}
return s.Font
} | go | func (s Style) GetFont(defaults ...*truetype.Font) *truetype.Font {
if s.Font == nil {
if len(defaults) > 0 {
return defaults[0]
}
return nil
}
return s.Font
} | [
"func",
"(",
"s",
"Style",
")",
"GetFont",
"(",
"defaults",
"...",
"*",
"truetype",
".",
"Font",
")",
"*",
"truetype",
".",
"Font",
"{",
"if",
"s",
".",
"Font",
"==",
"nil",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"return",
"defaul... | // GetFont returns the font face. | [
"GetFont",
"returns",
"the",
"font",
"face",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L266-L274 |
25,618 | wcharczuk/go-chart | style.go | GetPadding | func (s Style) GetPadding(defaults ...Box) Box {
if s.Padding.IsZero() {
if len(defaults) > 0 {
return defaults[0]
}
return Box{}
}
return s.Padding
} | go | func (s Style) GetPadding(defaults ...Box) Box {
if s.Padding.IsZero() {
if len(defaults) > 0 {
return defaults[0]
}
return Box{}
}
return s.Padding
} | [
"func",
"(",
"s",
"Style",
")",
"GetPadding",
"(",
"defaults",
"...",
"Box",
")",
"Box",
"{",
"if",
"s",
".",
"Padding",
".",
"IsZero",
"(",
")",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"return",
"defaults",
"[",
"0",
"]",
"\n",
... | // GetPadding returns the padding. | [
"GetPadding",
"returns",
"the",
"padding",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L277-L285 |
25,619 | wcharczuk/go-chart | style.go | GetTextHorizontalAlign | func (s Style) GetTextHorizontalAlign(defaults ...TextHorizontalAlign) TextHorizontalAlign {
if s.TextHorizontalAlign == TextHorizontalAlignUnset {
if len(defaults) > 0 {
return defaults[0]
}
return TextHorizontalAlignUnset
}
return s.TextHorizontalAlign
} | go | func (s Style) GetTextHorizontalAlign(defaults ...TextHorizontalAlign) TextHorizontalAlign {
if s.TextHorizontalAlign == TextHorizontalAlignUnset {
if len(defaults) > 0 {
return defaults[0]
}
return TextHorizontalAlignUnset
}
return s.TextHorizontalAlign
} | [
"func",
"(",
"s",
"Style",
")",
"GetTextHorizontalAlign",
"(",
"defaults",
"...",
"TextHorizontalAlign",
")",
"TextHorizontalAlign",
"{",
"if",
"s",
".",
"TextHorizontalAlign",
"==",
"TextHorizontalAlignUnset",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"... | // GetTextHorizontalAlign returns the horizontal alignment. | [
"GetTextHorizontalAlign",
"returns",
"the",
"horizontal",
"alignment",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L288-L296 |
25,620 | wcharczuk/go-chart | style.go | GetTextVerticalAlign | func (s Style) GetTextVerticalAlign(defaults ...TextVerticalAlign) TextVerticalAlign {
if s.TextVerticalAlign == TextVerticalAlignUnset {
if len(defaults) > 0 {
return defaults[0]
}
return TextVerticalAlignUnset
}
return s.TextVerticalAlign
} | go | func (s Style) GetTextVerticalAlign(defaults ...TextVerticalAlign) TextVerticalAlign {
if s.TextVerticalAlign == TextVerticalAlignUnset {
if len(defaults) > 0 {
return defaults[0]
}
return TextVerticalAlignUnset
}
return s.TextVerticalAlign
} | [
"func",
"(",
"s",
"Style",
")",
"GetTextVerticalAlign",
"(",
"defaults",
"...",
"TextVerticalAlign",
")",
"TextVerticalAlign",
"{",
"if",
"s",
".",
"TextVerticalAlign",
"==",
"TextVerticalAlignUnset",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"ret... | // GetTextVerticalAlign returns the vertical alignment. | [
"GetTextVerticalAlign",
"returns",
"the",
"vertical",
"alignment",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L299-L307 |
25,621 | wcharczuk/go-chart | style.go | GetTextWrap | func (s Style) GetTextWrap(defaults ...TextWrap) TextWrap {
if s.TextWrap == TextWrapUnset {
if len(defaults) > 0 {
return defaults[0]
}
return TextWrapUnset
}
return s.TextWrap
} | go | func (s Style) GetTextWrap(defaults ...TextWrap) TextWrap {
if s.TextWrap == TextWrapUnset {
if len(defaults) > 0 {
return defaults[0]
}
return TextWrapUnset
}
return s.TextWrap
} | [
"func",
"(",
"s",
"Style",
")",
"GetTextWrap",
"(",
"defaults",
"...",
"TextWrap",
")",
"TextWrap",
"{",
"if",
"s",
".",
"TextWrap",
"==",
"TextWrapUnset",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"return",
"defaults",
"[",
"0",
"]",
"\... | // GetTextWrap returns the word wrap. | [
"GetTextWrap",
"returns",
"the",
"word",
"wrap",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L310-L318 |
25,622 | wcharczuk/go-chart | style.go | GetTextRotationDegrees | func (s Style) GetTextRotationDegrees(defaults ...float64) float64 {
if s.TextRotationDegrees == 0 {
if len(defaults) > 0 {
return defaults[0]
}
}
return s.TextRotationDegrees
} | go | func (s Style) GetTextRotationDegrees(defaults ...float64) float64 {
if s.TextRotationDegrees == 0 {
if len(defaults) > 0 {
return defaults[0]
}
}
return s.TextRotationDegrees
} | [
"func",
"(",
"s",
"Style",
")",
"GetTextRotationDegrees",
"(",
"defaults",
"...",
"float64",
")",
"float64",
"{",
"if",
"s",
".",
"TextRotationDegrees",
"==",
"0",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"return",
"defaults",
"[",
"0",
"... | // GetTextRotationDegrees returns the text rotation in degrees. | [
"GetTextRotationDegrees",
"returns",
"the",
"text",
"rotation",
"in",
"degrees",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L332-L339 |
25,623 | wcharczuk/go-chart | style.go | WriteToRenderer | func (s Style) WriteToRenderer(r Renderer) {
r.SetClassName(s.GetClassName())
r.SetStrokeColor(s.GetStrokeColor())
r.SetStrokeWidth(s.GetStrokeWidth())
r.SetStrokeDashArray(s.GetStrokeDashArray())
r.SetFillColor(s.GetFillColor())
r.SetFont(s.GetFont())
r.SetFontColor(s.GetFontColor())
r.SetFontSize(s.GetFontSiz... | go | func (s Style) WriteToRenderer(r Renderer) {
r.SetClassName(s.GetClassName())
r.SetStrokeColor(s.GetStrokeColor())
r.SetStrokeWidth(s.GetStrokeWidth())
r.SetStrokeDashArray(s.GetStrokeDashArray())
r.SetFillColor(s.GetFillColor())
r.SetFont(s.GetFont())
r.SetFontColor(s.GetFontColor())
r.SetFontSize(s.GetFontSiz... | [
"func",
"(",
"s",
"Style",
")",
"WriteToRenderer",
"(",
"r",
"Renderer",
")",
"{",
"r",
".",
"SetClassName",
"(",
"s",
".",
"GetClassName",
"(",
")",
")",
"\n",
"r",
".",
"SetStrokeColor",
"(",
"s",
".",
"GetStrokeColor",
"(",
")",
")",
"\n",
"r",
... | // WriteToRenderer passes the style's options to a renderer. | [
"WriteToRenderer",
"passes",
"the",
"style",
"s",
"options",
"to",
"a",
"renderer",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L342-L356 |
25,624 | wcharczuk/go-chart | style.go | WriteDrawingOptionsToRenderer | func (s Style) WriteDrawingOptionsToRenderer(r Renderer) {
r.SetClassName(s.GetClassName())
r.SetStrokeColor(s.GetStrokeColor())
r.SetStrokeWidth(s.GetStrokeWidth())
r.SetStrokeDashArray(s.GetStrokeDashArray())
r.SetFillColor(s.GetFillColor())
} | go | func (s Style) WriteDrawingOptionsToRenderer(r Renderer) {
r.SetClassName(s.GetClassName())
r.SetStrokeColor(s.GetStrokeColor())
r.SetStrokeWidth(s.GetStrokeWidth())
r.SetStrokeDashArray(s.GetStrokeDashArray())
r.SetFillColor(s.GetFillColor())
} | [
"func",
"(",
"s",
"Style",
")",
"WriteDrawingOptionsToRenderer",
"(",
"r",
"Renderer",
")",
"{",
"r",
".",
"SetClassName",
"(",
"s",
".",
"GetClassName",
"(",
")",
")",
"\n",
"r",
".",
"SetStrokeColor",
"(",
"s",
".",
"GetStrokeColor",
"(",
")",
")",
"... | // WriteDrawingOptionsToRenderer passes just the drawing style options to a renderer. | [
"WriteDrawingOptionsToRenderer",
"passes",
"just",
"the",
"drawing",
"style",
"options",
"to",
"a",
"renderer",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L359-L365 |
25,625 | wcharczuk/go-chart | style.go | WriteTextOptionsToRenderer | func (s Style) WriteTextOptionsToRenderer(r Renderer) {
r.SetClassName(s.GetClassName())
r.SetFont(s.GetFont())
r.SetFontColor(s.GetFontColor())
r.SetFontSize(s.GetFontSize())
} | go | func (s Style) WriteTextOptionsToRenderer(r Renderer) {
r.SetClassName(s.GetClassName())
r.SetFont(s.GetFont())
r.SetFontColor(s.GetFontColor())
r.SetFontSize(s.GetFontSize())
} | [
"func",
"(",
"s",
"Style",
")",
"WriteTextOptionsToRenderer",
"(",
"r",
"Renderer",
")",
"{",
"r",
".",
"SetClassName",
"(",
"s",
".",
"GetClassName",
"(",
")",
")",
"\n",
"r",
".",
"SetFont",
"(",
"s",
".",
"GetFont",
"(",
")",
")",
"\n",
"r",
"."... | // WriteTextOptionsToRenderer passes just the text style options to a renderer. | [
"WriteTextOptionsToRenderer",
"passes",
"just",
"the",
"text",
"style",
"options",
"to",
"a",
"renderer",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L368-L373 |
25,626 | wcharczuk/go-chart | style.go | InheritFrom | func (s Style) InheritFrom(defaults Style) (final Style) {
final.ClassName = s.GetClassName(defaults.ClassName)
final.StrokeColor = s.GetStrokeColor(defaults.StrokeColor)
final.StrokeWidth = s.GetStrokeWidth(defaults.StrokeWidth)
final.StrokeDashArray = s.GetStrokeDashArray(defaults.StrokeDashArray)
final.DotCol... | go | func (s Style) InheritFrom(defaults Style) (final Style) {
final.ClassName = s.GetClassName(defaults.ClassName)
final.StrokeColor = s.GetStrokeColor(defaults.StrokeColor)
final.StrokeWidth = s.GetStrokeWidth(defaults.StrokeWidth)
final.StrokeDashArray = s.GetStrokeDashArray(defaults.StrokeDashArray)
final.DotCol... | [
"func",
"(",
"s",
"Style",
")",
"InheritFrom",
"(",
"defaults",
"Style",
")",
"(",
"final",
"Style",
")",
"{",
"final",
".",
"ClassName",
"=",
"s",
".",
"GetClassName",
"(",
"defaults",
".",
"ClassName",
")",
"\n\n",
"final",
".",
"StrokeColor",
"=",
"... | // InheritFrom coalesces two styles into a new style. | [
"InheritFrom",
"coalesces",
"two",
"styles",
"into",
"a",
"new",
"style",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L376-L401 |
25,627 | wcharczuk/go-chart | style.go | GetStrokeOptions | func (s Style) GetStrokeOptions() Style {
return Style{
ClassName: s.ClassName,
StrokeDashArray: s.StrokeDashArray,
StrokeColor: s.StrokeColor,
StrokeWidth: s.StrokeWidth,
}
} | go | func (s Style) GetStrokeOptions() Style {
return Style{
ClassName: s.ClassName,
StrokeDashArray: s.StrokeDashArray,
StrokeColor: s.StrokeColor,
StrokeWidth: s.StrokeWidth,
}
} | [
"func",
"(",
"s",
"Style",
")",
"GetStrokeOptions",
"(",
")",
"Style",
"{",
"return",
"Style",
"{",
"ClassName",
":",
"s",
".",
"ClassName",
",",
"StrokeDashArray",
":",
"s",
".",
"StrokeDashArray",
",",
"StrokeColor",
":",
"s",
".",
"StrokeColor",
",",
... | // GetStrokeOptions returns the stroke components. | [
"GetStrokeOptions",
"returns",
"the",
"stroke",
"components",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L404-L411 |
25,628 | wcharczuk/go-chart | style.go | GetFillOptions | func (s Style) GetFillOptions() Style {
return Style{
ClassName: s.ClassName,
FillColor: s.FillColor,
}
} | go | func (s Style) GetFillOptions() Style {
return Style{
ClassName: s.ClassName,
FillColor: s.FillColor,
}
} | [
"func",
"(",
"s",
"Style",
")",
"GetFillOptions",
"(",
")",
"Style",
"{",
"return",
"Style",
"{",
"ClassName",
":",
"s",
".",
"ClassName",
",",
"FillColor",
":",
"s",
".",
"FillColor",
",",
"}",
"\n",
"}"
] | // GetFillOptions returns the fill components. | [
"GetFillOptions",
"returns",
"the",
"fill",
"components",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L414-L419 |
25,629 | wcharczuk/go-chart | style.go | GetDotOptions | func (s Style) GetDotOptions() Style {
return Style{
ClassName: s.ClassName,
StrokeDashArray: nil,
FillColor: s.DotColor,
StrokeColor: s.DotColor,
StrokeWidth: 1.0,
}
} | go | func (s Style) GetDotOptions() Style {
return Style{
ClassName: s.ClassName,
StrokeDashArray: nil,
FillColor: s.DotColor,
StrokeColor: s.DotColor,
StrokeWidth: 1.0,
}
} | [
"func",
"(",
"s",
"Style",
")",
"GetDotOptions",
"(",
")",
"Style",
"{",
"return",
"Style",
"{",
"ClassName",
":",
"s",
".",
"ClassName",
",",
"StrokeDashArray",
":",
"nil",
",",
"FillColor",
":",
"s",
".",
"DotColor",
",",
"StrokeColor",
":",
"s",
"."... | // GetDotOptions returns the dot components. | [
"GetDotOptions",
"returns",
"the",
"dot",
"components",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L422-L430 |
25,630 | wcharczuk/go-chart | style.go | GetFillAndStrokeOptions | func (s Style) GetFillAndStrokeOptions() Style {
return Style{
ClassName: s.ClassName,
StrokeDashArray: s.StrokeDashArray,
FillColor: s.FillColor,
StrokeColor: s.StrokeColor,
StrokeWidth: s.StrokeWidth,
}
} | go | func (s Style) GetFillAndStrokeOptions() Style {
return Style{
ClassName: s.ClassName,
StrokeDashArray: s.StrokeDashArray,
FillColor: s.FillColor,
StrokeColor: s.StrokeColor,
StrokeWidth: s.StrokeWidth,
}
} | [
"func",
"(",
"s",
"Style",
")",
"GetFillAndStrokeOptions",
"(",
")",
"Style",
"{",
"return",
"Style",
"{",
"ClassName",
":",
"s",
".",
"ClassName",
",",
"StrokeDashArray",
":",
"s",
".",
"StrokeDashArray",
",",
"FillColor",
":",
"s",
".",
"FillColor",
",",... | // GetFillAndStrokeOptions returns the fill and stroke components. | [
"GetFillAndStrokeOptions",
"returns",
"the",
"fill",
"and",
"stroke",
"components",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L433-L441 |
25,631 | wcharczuk/go-chart | style.go | GetTextOptions | func (s Style) GetTextOptions() Style {
return Style{
ClassName: s.ClassName,
FontColor: s.FontColor,
FontSize: s.FontSize,
Font: s.Font,
TextHorizontalAlign: s.TextHorizontalAlign,
TextVerticalAlign: s.TextVerticalAlign,
TextWrap: s.TextWrap,
... | go | func (s Style) GetTextOptions() Style {
return Style{
ClassName: s.ClassName,
FontColor: s.FontColor,
FontSize: s.FontSize,
Font: s.Font,
TextHorizontalAlign: s.TextHorizontalAlign,
TextVerticalAlign: s.TextVerticalAlign,
TextWrap: s.TextWrap,
... | [
"func",
"(",
"s",
"Style",
")",
"GetTextOptions",
"(",
")",
"Style",
"{",
"return",
"Style",
"{",
"ClassName",
":",
"s",
".",
"ClassName",
",",
"FontColor",
":",
"s",
".",
"FontColor",
",",
"FontSize",
":",
"s",
".",
"FontSize",
",",
"Font",
":",
"s"... | // GetTextOptions returns just the text components of the style. | [
"GetTextOptions",
"returns",
"just",
"the",
"text",
"components",
"of",
"the",
"style",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L444-L456 |
25,632 | wcharczuk/go-chart | style.go | ShouldDrawDot | func (s Style) ShouldDrawDot() bool {
return (!s.DotColor.IsZero() && s.DotWidth > 0) || s.DotColorProvider != nil || s.DotWidthProvider != nil
} | go | func (s Style) ShouldDrawDot() bool {
return (!s.DotColor.IsZero() && s.DotWidth > 0) || s.DotColorProvider != nil || s.DotWidthProvider != nil
} | [
"func",
"(",
"s",
"Style",
")",
"ShouldDrawDot",
"(",
")",
"bool",
"{",
"return",
"(",
"!",
"s",
".",
"DotColor",
".",
"IsZero",
"(",
")",
"&&",
"s",
".",
"DotWidth",
">",
"0",
")",
"||",
"s",
".",
"DotColorProvider",
"!=",
"nil",
"||",
"s",
".",... | // ShouldDrawDot tells drawing functions if they should draw the dot. | [
"ShouldDrawDot",
"tells",
"drawing",
"functions",
"if",
"they",
"should",
"draw",
"the",
"dot",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/style.go#L464-L466 |
25,633 | wcharczuk/go-chart | matrix/regression.go | Poly | func Poly(xvalues, yvalues []float64, degree int) ([]float64, error) {
if len(xvalues) != len(yvalues) {
return nil, ErrPolyRegArraysSameLength
}
m := len(yvalues)
n := degree + 1
y := New(m, 1, yvalues...)
x := Zero(m, n)
for i := 0; i < m; i++ {
ip := float64(1)
for j := 0; j < n; j++ {
x.Set(i, j, ... | go | func Poly(xvalues, yvalues []float64, degree int) ([]float64, error) {
if len(xvalues) != len(yvalues) {
return nil, ErrPolyRegArraysSameLength
}
m := len(yvalues)
n := degree + 1
y := New(m, 1, yvalues...)
x := Zero(m, n)
for i := 0; i < m; i++ {
ip := float64(1)
for j := 0; j < n; j++ {
x.Set(i, j, ... | [
"func",
"Poly",
"(",
"xvalues",
",",
"yvalues",
"[",
"]",
"float64",
",",
"degree",
"int",
")",
"(",
"[",
"]",
"float64",
",",
"error",
")",
"{",
"if",
"len",
"(",
"xvalues",
")",
"!=",
"len",
"(",
"yvalues",
")",
"{",
"return",
"nil",
",",
"ErrP... | // Poly returns the polynomial regress of a given degree over the given values. | [
"Poly",
"returns",
"the",
"polynomial",
"regress",
"of",
"a",
"given",
"degree",
"over",
"the",
"given",
"values",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/matrix/regression.go#L11-L45 |
25,634 | wcharczuk/go-chart | linear_coefficient_provider.go | LinearCoefficients | func LinearCoefficients(m, b float64) LinearCoefficientSet {
return LinearCoefficientSet{
M: m,
B: b,
}
} | go | func LinearCoefficients(m, b float64) LinearCoefficientSet {
return LinearCoefficientSet{
M: m,
B: b,
}
} | [
"func",
"LinearCoefficients",
"(",
"m",
",",
"b",
"float64",
")",
"LinearCoefficientSet",
"{",
"return",
"LinearCoefficientSet",
"{",
"M",
":",
"m",
",",
"B",
":",
"b",
",",
"}",
"\n",
"}"
] | // LinearCoefficients returns a fixed linear coefficient pair. | [
"LinearCoefficients",
"returns",
"a",
"fixed",
"linear",
"coefficient",
"pair",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/linear_coefficient_provider.go#L9-L14 |
25,635 | wcharczuk/go-chart | linear_coefficient_provider.go | NormalizedLinearCoefficients | func NormalizedLinearCoefficients(m, b, stdev, avg float64) LinearCoefficientSet {
return LinearCoefficientSet{
M: m,
B: b,
StdDev: stdev,
Avg: avg,
}
} | go | func NormalizedLinearCoefficients(m, b, stdev, avg float64) LinearCoefficientSet {
return LinearCoefficientSet{
M: m,
B: b,
StdDev: stdev,
Avg: avg,
}
} | [
"func",
"NormalizedLinearCoefficients",
"(",
"m",
",",
"b",
",",
"stdev",
",",
"avg",
"float64",
")",
"LinearCoefficientSet",
"{",
"return",
"LinearCoefficientSet",
"{",
"M",
":",
"m",
",",
"B",
":",
"b",
",",
"StdDev",
":",
"stdev",
",",
"Avg",
":",
"av... | // NormalizedLinearCoefficients returns a fixed linear coefficient pair. | [
"NormalizedLinearCoefficients",
"returns",
"a",
"fixed",
"linear",
"coefficient",
"pair",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/linear_coefficient_provider.go#L17-L24 |
25,636 | wcharczuk/go-chart | linear_coefficient_provider.go | Coefficients | func (lcs LinearCoefficientSet) Coefficients() (m, b, stdev, avg float64) {
m = lcs.M
b = lcs.B
stdev = lcs.StdDev
avg = lcs.Avg
return
} | go | func (lcs LinearCoefficientSet) Coefficients() (m, b, stdev, avg float64) {
m = lcs.M
b = lcs.B
stdev = lcs.StdDev
avg = lcs.Avg
return
} | [
"func",
"(",
"lcs",
"LinearCoefficientSet",
")",
"Coefficients",
"(",
")",
"(",
"m",
",",
"b",
",",
"stdev",
",",
"avg",
"float64",
")",
"{",
"m",
"=",
"lcs",
".",
"M",
"\n",
"b",
"=",
"lcs",
".",
"B",
"\n",
"stdev",
"=",
"lcs",
".",
"StdDev",
... | // Coefficients returns the coefficients. | [
"Coefficients",
"returns",
"the",
"coefficients",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/linear_coefficient_provider.go#L36-L42 |
25,637 | wcharczuk/go-chart | grid_line.go | Render | func (gl GridLine) Render(r Renderer, canvasBox Box, ra Range, isVertical bool, defaults Style) {
r.SetStrokeColor(gl.Style.GetStrokeColor(defaults.GetStrokeColor()))
r.SetStrokeWidth(gl.Style.GetStrokeWidth(defaults.GetStrokeWidth()))
r.SetStrokeDashArray(gl.Style.GetStrokeDashArray(defaults.GetStrokeDashArray()))
... | go | func (gl GridLine) Render(r Renderer, canvasBox Box, ra Range, isVertical bool, defaults Style) {
r.SetStrokeColor(gl.Style.GetStrokeColor(defaults.GetStrokeColor()))
r.SetStrokeWidth(gl.Style.GetStrokeWidth(defaults.GetStrokeWidth()))
r.SetStrokeDashArray(gl.Style.GetStrokeDashArray(defaults.GetStrokeDashArray()))
... | [
"func",
"(",
"gl",
"GridLine",
")",
"Render",
"(",
"r",
"Renderer",
",",
"canvasBox",
"Box",
",",
"ra",
"Range",
",",
"isVertical",
"bool",
",",
"defaults",
"Style",
")",
"{",
"r",
".",
"SetStrokeColor",
"(",
"gl",
".",
"Style",
".",
"GetStrokeColor",
... | // Render renders the gridline | [
"Render",
"renders",
"the",
"gridline"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/grid_line.go#L26-L48 |
25,638 | wcharczuk/go-chart | grid_line.go | GenerateGridLines | func GenerateGridLines(ticks []Tick, majorStyle, minorStyle Style) []GridLine {
var gl []GridLine
isMinor := false
if len(ticks) < 3 {
return gl
}
for _, t := range ticks[1 : len(ticks)-1] {
s := majorStyle
if isMinor {
s = minorStyle
}
gl = append(gl, GridLine{
Style: s,
IsMinor: isMinor,
... | go | func GenerateGridLines(ticks []Tick, majorStyle, minorStyle Style) []GridLine {
var gl []GridLine
isMinor := false
if len(ticks) < 3 {
return gl
}
for _, t := range ticks[1 : len(ticks)-1] {
s := majorStyle
if isMinor {
s = minorStyle
}
gl = append(gl, GridLine{
Style: s,
IsMinor: isMinor,
... | [
"func",
"GenerateGridLines",
"(",
"ticks",
"[",
"]",
"Tick",
",",
"majorStyle",
",",
"minorStyle",
"Style",
")",
"[",
"]",
"GridLine",
"{",
"var",
"gl",
"[",
"]",
"GridLine",
"\n",
"isMinor",
":=",
"false",
"\n\n",
"if",
"len",
"(",
"ticks",
")",
"<",
... | // GenerateGridLines generates grid lines. | [
"GenerateGridLines",
"generates",
"grid",
"lines",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/grid_line.go#L51-L72 |
25,639 | wcharczuk/go-chart | histogram_series.go | GetValues | func (hs HistogramSeries) GetValues(index int) (x, y float64) {
return hs.InnerSeries.GetValues(index)
} | go | func (hs HistogramSeries) GetValues(index int) (x, y float64) {
return hs.InnerSeries.GetValues(index)
} | [
"func",
"(",
"hs",
"HistogramSeries",
")",
"GetValues",
"(",
"index",
"int",
")",
"(",
"x",
",",
"y",
"float64",
")",
"{",
"return",
"hs",
".",
"InnerSeries",
".",
"GetValues",
"(",
"index",
")",
"\n",
"}"
] | // GetValues implements ValuesProvider.GetValues. | [
"GetValues",
"implements",
"ValuesProvider",
".",
"GetValues",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/histogram_series.go#L36-L38 |
25,640 | wcharczuk/go-chart | histogram_series.go | GetBoundedValues | func (hs HistogramSeries) GetBoundedValues(index int) (x, y1, y2 float64) {
vx, vy := hs.InnerSeries.GetValues(index)
x = vx
if vy > 0 {
y1 = vy
return
}
y2 = vy
return
} | go | func (hs HistogramSeries) GetBoundedValues(index int) (x, y1, y2 float64) {
vx, vy := hs.InnerSeries.GetValues(index)
x = vx
if vy > 0 {
y1 = vy
return
}
y2 = vy
return
} | [
"func",
"(",
"hs",
"HistogramSeries",
")",
"GetBoundedValues",
"(",
"index",
"int",
")",
"(",
"x",
",",
"y1",
",",
"y2",
"float64",
")",
"{",
"vx",
",",
"vy",
":=",
"hs",
".",
"InnerSeries",
".",
"GetValues",
"(",
"index",
")",
"\n\n",
"x",
"=",
"v... | // GetBoundedValues implements BoundedValuesProvider.GetBoundedValue | [
"GetBoundedValues",
"implements",
"BoundedValuesProvider",
".",
"GetBoundedValue"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/histogram_series.go#L41-L53 |
25,641 | wcharczuk/go-chart | histogram_series.go | Render | func (hs HistogramSeries) Render(r Renderer, canvasBox Box, xrange, yrange Range, defaults Style) {
style := hs.Style.InheritFrom(defaults)
Draw.HistogramSeries(r, canvasBox, xrange, yrange, style, hs)
} | go | func (hs HistogramSeries) Render(r Renderer, canvasBox Box, xrange, yrange Range, defaults Style) {
style := hs.Style.InheritFrom(defaults)
Draw.HistogramSeries(r, canvasBox, xrange, yrange, style, hs)
} | [
"func",
"(",
"hs",
"HistogramSeries",
")",
"Render",
"(",
"r",
"Renderer",
",",
"canvasBox",
"Box",
",",
"xrange",
",",
"yrange",
"Range",
",",
"defaults",
"Style",
")",
"{",
"style",
":=",
"hs",
".",
"Style",
".",
"InheritFrom",
"(",
"defaults",
")",
... | // Render implements Series.Render. | [
"Render",
"implements",
"Series",
".",
"Render",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/histogram_series.go#L56-L59 |
25,642 | wcharczuk/go-chart | util/date.go | Eastern | func (d date) Eastern() (*time.Location, error) {
// Try POSIX
est, err := time.LoadLocation("America/New_York")
if err != nil {
// Try Windows
est, err = time.LoadLocation("EST")
if err != nil {
return nil, err
}
}
return est, nil
} | go | func (d date) Eastern() (*time.Location, error) {
// Try POSIX
est, err := time.LoadLocation("America/New_York")
if err != nil {
// Try Windows
est, err = time.LoadLocation("EST")
if err != nil {
return nil, err
}
}
return est, nil
} | [
"func",
"(",
"d",
"date",
")",
"Eastern",
"(",
")",
"(",
"*",
"time",
".",
"Location",
",",
"error",
")",
"{",
"// Try POSIX",
"est",
",",
"err",
":=",
"time",
".",
"LoadLocation",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"// Tr... | // Eastern returns the eastern timezone. | [
"Eastern",
"returns",
"the",
"eastern",
"timezone",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/date.go#L61-L72 |
25,643 | wcharczuk/go-chart | util/date.go | Pacific | func (d date) Pacific() (*time.Location, error) {
// Try POSIX
pst, err := time.LoadLocation("America/Los_Angeles")
if err != nil {
// Try Windows
pst, err = time.LoadLocation("PST")
if err != nil {
return nil, err
}
}
return pst, nil
} | go | func (d date) Pacific() (*time.Location, error) {
// Try POSIX
pst, err := time.LoadLocation("America/Los_Angeles")
if err != nil {
// Try Windows
pst, err = time.LoadLocation("PST")
if err != nil {
return nil, err
}
}
return pst, nil
} | [
"func",
"(",
"d",
"date",
")",
"Pacific",
"(",
")",
"(",
"*",
"time",
".",
"Location",
",",
"error",
")",
"{",
"// Try POSIX",
"pst",
",",
"err",
":=",
"time",
".",
"LoadLocation",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"// Tr... | // Pacific returns the pacific timezone. | [
"Pacific",
"returns",
"the",
"pacific",
"timezone",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/date.go#L83-L94 |
25,644 | wcharczuk/go-chart | util/date.go | TimeUTC | func (d date) TimeUTC(hour, min, sec, nsec int) time.Time {
return time.Date(0, 0, 0, hour, min, sec, nsec, time.UTC)
} | go | func (d date) TimeUTC(hour, min, sec, nsec int) time.Time {
return time.Date(0, 0, 0, hour, min, sec, nsec, time.UTC)
} | [
"func",
"(",
"d",
"date",
")",
"TimeUTC",
"(",
"hour",
",",
"min",
",",
"sec",
",",
"nsec",
"int",
")",
"time",
".",
"Time",
"{",
"return",
"time",
".",
"Date",
"(",
"0",
",",
"0",
",",
"0",
",",
"hour",
",",
"min",
",",
"sec",
",",
"nsec",
... | // TimeUTC returns a new time.Time for the given clock components in UTC.
// It is meant to be used with the `OnDate` function. | [
"TimeUTC",
"returns",
"a",
"new",
"time",
".",
"Time",
"for",
"the",
"given",
"clock",
"components",
"in",
"UTC",
".",
"It",
"is",
"meant",
"to",
"be",
"used",
"with",
"the",
"OnDate",
"function",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/date.go#L98-L100 |
25,645 | wcharczuk/go-chart | util/date.go | Time | func (d date) Time(hour, min, sec, nsec int, loc *time.Location) time.Time {
return time.Date(0, 0, 0, hour, min, sec, nsec, loc)
} | go | func (d date) Time(hour, min, sec, nsec int, loc *time.Location) time.Time {
return time.Date(0, 0, 0, hour, min, sec, nsec, loc)
} | [
"func",
"(",
"d",
"date",
")",
"Time",
"(",
"hour",
",",
"min",
",",
"sec",
",",
"nsec",
"int",
",",
"loc",
"*",
"time",
".",
"Location",
")",
"time",
".",
"Time",
"{",
"return",
"time",
".",
"Date",
"(",
"0",
",",
"0",
",",
"0",
",",
"hour",... | // Time returns a new time.Time for the given clock components.
// It is meant to be used with the `OnDate` function. | [
"Time",
"returns",
"a",
"new",
"time",
".",
"Time",
"for",
"the",
"given",
"clock",
"components",
".",
"It",
"is",
"meant",
"to",
"be",
"used",
"with",
"the",
"OnDate",
"function",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/date.go#L104-L106 |
25,646 | wcharczuk/go-chart | util/date.go | IsWeekDay | func (d date) IsWeekDay(day time.Weekday) bool {
return !d.IsWeekendDay(day)
} | go | func (d date) IsWeekDay(day time.Weekday) bool {
return !d.IsWeekendDay(day)
} | [
"func",
"(",
"d",
"date",
")",
"IsWeekDay",
"(",
"day",
"time",
".",
"Weekday",
")",
"bool",
"{",
"return",
"!",
"d",
".",
"IsWeekendDay",
"(",
"day",
")",
"\n",
"}"
] | // IsWeekDay returns if the day is a monday->friday. | [
"IsWeekDay",
"returns",
"if",
"the",
"day",
"is",
"a",
"monday",
"-",
">",
"friday",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/date.go#L130-L132 |
25,647 | wcharczuk/go-chart | util/date.go | IsWeekendDay | func (d date) IsWeekendDay(day time.Weekday) bool {
return day == time.Saturday || day == time.Sunday
} | go | func (d date) IsWeekendDay(day time.Weekday) bool {
return day == time.Saturday || day == time.Sunday
} | [
"func",
"(",
"d",
"date",
")",
"IsWeekendDay",
"(",
"day",
"time",
".",
"Weekday",
")",
"bool",
"{",
"return",
"day",
"==",
"time",
".",
"Saturday",
"||",
"day",
"==",
"time",
".",
"Sunday",
"\n",
"}"
] | // IsWeekendDay returns if the day is a monday->friday. | [
"IsWeekendDay",
"returns",
"if",
"the",
"day",
"is",
"a",
"monday",
"-",
">",
"friday",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/date.go#L135-L137 |
25,648 | wcharczuk/go-chart | util/date.go | NextDay | func (d date) NextDay(ts time.Time) time.Time {
return ts.AddDate(0, 0, 1)
} | go | func (d date) NextDay(ts time.Time) time.Time {
return ts.AddDate(0, 0, 1)
} | [
"func",
"(",
"d",
"date",
")",
"NextDay",
"(",
"ts",
"time",
".",
"Time",
")",
"time",
".",
"Time",
"{",
"return",
"ts",
".",
"AddDate",
"(",
"0",
",",
"0",
",",
"1",
")",
"\n",
"}"
] | // NextDay returns the timestamp advanced a day. | [
"NextDay",
"returns",
"the",
"timestamp",
"advanced",
"a",
"day",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/date.go#L157-L159 |
25,649 | wcharczuk/go-chart | util/date.go | NextHour | func (d date) NextHour(ts time.Time) time.Time {
//advance a full hour ...
advanced := ts.Add(time.Hour)
minutes := time.Duration(advanced.Minute()) * time.Minute
final := advanced.Add(-minutes)
return time.Date(final.Year(), final.Month(), final.Day(), final.Hour(), 0, 0, 0, final.Location())
} | go | func (d date) NextHour(ts time.Time) time.Time {
//advance a full hour ...
advanced := ts.Add(time.Hour)
minutes := time.Duration(advanced.Minute()) * time.Minute
final := advanced.Add(-minutes)
return time.Date(final.Year(), final.Month(), final.Day(), final.Hour(), 0, 0, 0, final.Location())
} | [
"func",
"(",
"d",
"date",
")",
"NextHour",
"(",
"ts",
"time",
".",
"Time",
")",
"time",
".",
"Time",
"{",
"//advance a full hour ...",
"advanced",
":=",
"ts",
".",
"Add",
"(",
"time",
".",
"Hour",
")",
"\n",
"minutes",
":=",
"time",
".",
"Duration",
... | // NextHour returns the next timestamp on the hour. | [
"NextHour",
"returns",
"the",
"next",
"timestamp",
"on",
"the",
"hour",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/date.go#L162-L168 |
25,650 | wcharczuk/go-chart | util/date.go | NextDayOfWeek | func (d date) NextDayOfWeek(after time.Time, dayOfWeek time.Weekday) time.Time {
afterWeekday := after.Weekday()
if afterWeekday == dayOfWeek {
return after.AddDate(0, 0, 7)
}
// 1 vs 5 ~ add 4 days
if afterWeekday < dayOfWeek {
dayDelta := int(dayOfWeek - afterWeekday)
return after.AddDate(0, 0, dayDelta)
... | go | func (d date) NextDayOfWeek(after time.Time, dayOfWeek time.Weekday) time.Time {
afterWeekday := after.Weekday()
if afterWeekday == dayOfWeek {
return after.AddDate(0, 0, 7)
}
// 1 vs 5 ~ add 4 days
if afterWeekday < dayOfWeek {
dayDelta := int(dayOfWeek - afterWeekday)
return after.AddDate(0, 0, dayDelta)
... | [
"func",
"(",
"d",
"date",
")",
"NextDayOfWeek",
"(",
"after",
"time",
".",
"Time",
",",
"dayOfWeek",
"time",
".",
"Weekday",
")",
"time",
".",
"Time",
"{",
"afterWeekday",
":=",
"after",
".",
"Weekday",
"(",
")",
"\n",
"if",
"afterWeekday",
"==",
"dayO... | // NextDayOfWeek returns the next instance of a given weekday after a given timestamp. | [
"NextDayOfWeek",
"returns",
"the",
"next",
"instance",
"of",
"a",
"given",
"weekday",
"after",
"a",
"given",
"timestamp",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/util/date.go#L171-L186 |
25,651 | wcharczuk/go-chart | seq/random.go | RandomValuesWithMax | func RandomValuesWithMax(count int, max float64) []float64 {
return Seq{NewRandom().WithMax(max).WithLen(count)}.Array()
} | go | func RandomValuesWithMax(count int, max float64) []float64 {
return Seq{NewRandom().WithMax(max).WithLen(count)}.Array()
} | [
"func",
"RandomValuesWithMax",
"(",
"count",
"int",
",",
"max",
"float64",
")",
"[",
"]",
"float64",
"{",
"return",
"Seq",
"{",
"NewRandom",
"(",
")",
".",
"WithMax",
"(",
"max",
")",
".",
"WithLen",
"(",
"count",
")",
"}",
".",
"Array",
"(",
")",
... | // RandomValuesWithMax returns an array of random values with a given average. | [
"RandomValuesWithMax",
"returns",
"an",
"array",
"of",
"random",
"values",
"with",
"a",
"given",
"average",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/random.go#L15-L17 |
25,652 | wcharczuk/go-chart | seq/random.go | NewRandom | func NewRandom() *Random {
return &Random{
rnd: rand.New(rand.NewSource(time.Now().Unix())),
}
} | go | func NewRandom() *Random {
return &Random{
rnd: rand.New(rand.NewSource(time.Now().Unix())),
}
} | [
"func",
"NewRandom",
"(",
")",
"*",
"Random",
"{",
"return",
"&",
"Random",
"{",
"rnd",
":",
"rand",
".",
"New",
"(",
"rand",
".",
"NewSource",
"(",
"time",
".",
"Now",
"(",
")",
".",
"Unix",
"(",
")",
")",
")",
",",
"}",
"\n",
"}"
] | // NewRandom creates a new random seq. | [
"NewRandom",
"creates",
"a",
"new",
"random",
"seq",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/random.go#L20-L24 |
25,653 | wcharczuk/go-chart | seq/random.go | Len | func (r *Random) Len() int {
if r.len != nil {
return *r.len
}
return math.MaxInt32
} | go | func (r *Random) Len() int {
if r.len != nil {
return *r.len
}
return math.MaxInt32
} | [
"func",
"(",
"r",
"*",
"Random",
")",
"Len",
"(",
")",
"int",
"{",
"if",
"r",
".",
"len",
"!=",
"nil",
"{",
"return",
"*",
"r",
".",
"len",
"\n",
"}",
"\n",
"return",
"math",
".",
"MaxInt32",
"\n",
"}"
] | // Len returns the number of elements that will be generated. | [
"Len",
"returns",
"the",
"number",
"of",
"elements",
"that",
"will",
"be",
"generated",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/random.go#L35-L40 |
25,654 | wcharczuk/go-chart | seq/random.go | GetValue | func (r *Random) GetValue(_ int) float64 {
if r.min != nil && r.max != nil {
var delta float64
if *r.max > *r.min {
delta = *r.max - *r.min
} else {
delta = *r.min - *r.max
}
return *r.min + (r.rnd.Float64() * delta)
} else if r.max != nil {
return r.rnd.Float64() * *r.max
} else if r.min != nil ... | go | func (r *Random) GetValue(_ int) float64 {
if r.min != nil && r.max != nil {
var delta float64
if *r.max > *r.min {
delta = *r.max - *r.min
} else {
delta = *r.min - *r.max
}
return *r.min + (r.rnd.Float64() * delta)
} else if r.max != nil {
return r.rnd.Float64() * *r.max
} else if r.min != nil ... | [
"func",
"(",
"r",
"*",
"Random",
")",
"GetValue",
"(",
"_",
"int",
")",
"float64",
"{",
"if",
"r",
".",
"min",
"!=",
"nil",
"&&",
"r",
".",
"max",
"!=",
"nil",
"{",
"var",
"delta",
"float64",
"\n\n",
"if",
"*",
"r",
".",
"max",
">",
"*",
"r",... | // GetValue returns the value. | [
"GetValue",
"returns",
"the",
"value",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/random.go#L43-L60 |
25,655 | wcharczuk/go-chart | seq/random.go | WithLen | func (r *Random) WithLen(length int) *Random {
r.len = &length
return r
} | go | func (r *Random) WithLen(length int) *Random {
r.len = &length
return r
} | [
"func",
"(",
"r",
"*",
"Random",
")",
"WithLen",
"(",
"length",
"int",
")",
"*",
"Random",
"{",
"r",
".",
"len",
"=",
"&",
"length",
"\n",
"return",
"r",
"\n",
"}"
] | // WithLen sets a maximum len | [
"WithLen",
"sets",
"a",
"maximum",
"len"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/random.go#L63-L66 |
25,656 | wcharczuk/go-chart | seq/random.go | WithMin | func (r *Random) WithMin(min float64) *Random {
r.min = &min
return r
} | go | func (r *Random) WithMin(min float64) *Random {
r.min = &min
return r
} | [
"func",
"(",
"r",
"*",
"Random",
")",
"WithMin",
"(",
"min",
"float64",
")",
"*",
"Random",
"{",
"r",
".",
"min",
"=",
"&",
"min",
"\n",
"return",
"r",
"\n",
"}"
] | // WithMin sets the scale and returns the Random. | [
"WithMin",
"sets",
"the",
"scale",
"and",
"returns",
"the",
"Random",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/random.go#L74-L77 |
25,657 | wcharczuk/go-chart | seq/random.go | WithMax | func (r *Random) WithMax(max float64) *Random {
r.max = &max
return r
} | go | func (r *Random) WithMax(max float64) *Random {
r.max = &max
return r
} | [
"func",
"(",
"r",
"*",
"Random",
")",
"WithMax",
"(",
"max",
"float64",
")",
"*",
"Random",
"{",
"r",
".",
"max",
"=",
"&",
"max",
"\n",
"return",
"r",
"\n",
"}"
] | // WithMax sets the average and returns the Random. | [
"WithMax",
"sets",
"the",
"average",
"and",
"returns",
"the",
"Random",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/random.go#L85-L88 |
25,658 | wcharczuk/go-chart | continuous_range.go | IsZero | func (r ContinuousRange) IsZero() bool {
return (r.Min == 0 || math.IsNaN(r.Min)) &&
(r.Max == 0 || math.IsNaN(r.Max)) &&
r.Domain == 0
} | go | func (r ContinuousRange) IsZero() bool {
return (r.Min == 0 || math.IsNaN(r.Min)) &&
(r.Max == 0 || math.IsNaN(r.Max)) &&
r.Domain == 0
} | [
"func",
"(",
"r",
"ContinuousRange",
")",
"IsZero",
"(",
")",
"bool",
"{",
"return",
"(",
"r",
".",
"Min",
"==",
"0",
"||",
"math",
".",
"IsNaN",
"(",
"r",
".",
"Min",
")",
")",
"&&",
"(",
"r",
".",
"Max",
"==",
"0",
"||",
"math",
".",
"IsNaN... | // IsZero returns if the ContinuousRange has been set or not. | [
"IsZero",
"returns",
"if",
"the",
"ContinuousRange",
"has",
"been",
"set",
"or",
"not",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/continuous_range.go#L22-L26 |
25,659 | wcharczuk/go-chart | continuous_range.go | String | func (r ContinuousRange) String() string {
return fmt.Sprintf("ContinuousRange [%.2f,%.2f] => %d", r.Min, r.Max, r.Domain)
} | go | func (r ContinuousRange) String() string {
return fmt.Sprintf("ContinuousRange [%.2f,%.2f] => %d", r.Min, r.Max, r.Domain)
} | [
"func",
"(",
"r",
"ContinuousRange",
")",
"String",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"r",
".",
"Min",
",",
"r",
".",
"Max",
",",
"r",
".",
"Domain",
")",
"\n",
"}"
] | // String returns a simple string for the ContinuousRange. | [
"String",
"returns",
"a",
"simple",
"string",
"for",
"the",
"ContinuousRange",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/continuous_range.go#L64-L66 |
25,660 | wcharczuk/go-chart | continuous_range.go | Translate | func (r ContinuousRange) Translate(value float64) int {
normalized := value - r.Min
ratio := normalized / r.GetDelta()
if r.IsDescending() {
return r.Domain - int(math.Ceil(ratio*float64(r.Domain)))
}
return int(math.Ceil(ratio * float64(r.Domain)))
} | go | func (r ContinuousRange) Translate(value float64) int {
normalized := value - r.Min
ratio := normalized / r.GetDelta()
if r.IsDescending() {
return r.Domain - int(math.Ceil(ratio*float64(r.Domain)))
}
return int(math.Ceil(ratio * float64(r.Domain)))
} | [
"func",
"(",
"r",
"ContinuousRange",
")",
"Translate",
"(",
"value",
"float64",
")",
"int",
"{",
"normalized",
":=",
"value",
"-",
"r",
".",
"Min",
"\n",
"ratio",
":=",
"normalized",
"/",
"r",
".",
"GetDelta",
"(",
")",
"\n\n",
"if",
"r",
".",
"IsDes... | // Translate maps a given value into the ContinuousRange space. | [
"Translate",
"maps",
"a",
"given",
"value",
"into",
"the",
"ContinuousRange",
"space",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/continuous_range.go#L69-L78 |
25,661 | wcharczuk/go-chart | bollinger_band_series.go | GetK | func (bbs BollingerBandsSeries) GetK(defaults ...float64) float64 {
if bbs.K == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return 2.0
}
return bbs.K
} | go | func (bbs BollingerBandsSeries) GetK(defaults ...float64) float64 {
if bbs.K == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return 2.0
}
return bbs.K
} | [
"func",
"(",
"bbs",
"BollingerBandsSeries",
")",
"GetK",
"(",
"defaults",
"...",
"float64",
")",
"float64",
"{",
"if",
"bbs",
".",
"K",
"==",
"0",
"{",
"if",
"len",
"(",
"defaults",
")",
">",
"0",
"{",
"return",
"defaults",
"[",
"0",
"]",
"\n",
"}"... | // GetK returns the K value, or the number of standard deviations above and below
// to band the simple moving average with.
// Typical K value is 2.0. | [
"GetK",
"returns",
"the",
"K",
"value",
"or",
"the",
"number",
"of",
"standard",
"deviations",
"above",
"and",
"below",
"to",
"band",
"the",
"simple",
"moving",
"average",
"with",
".",
"Typical",
"K",
"value",
"is",
"2",
".",
"0",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/bollinger_band_series.go#L54-L62 |
25,662 | wcharczuk/go-chart | bollinger_band_series.go | GetBoundedValues | func (bbs *BollingerBandsSeries) GetBoundedValues(index int) (x, y1, y2 float64) {
if bbs.InnerSeries == nil {
return
}
if bbs.valueBuffer == nil || index == 0 {
bbs.valueBuffer = seq.NewBufferWithCapacity(bbs.GetPeriod())
}
if bbs.valueBuffer.Len() >= bbs.GetPeriod() {
bbs.valueBuffer.Dequeue()
}
px, py :... | go | func (bbs *BollingerBandsSeries) GetBoundedValues(index int) (x, y1, y2 float64) {
if bbs.InnerSeries == nil {
return
}
if bbs.valueBuffer == nil || index == 0 {
bbs.valueBuffer = seq.NewBufferWithCapacity(bbs.GetPeriod())
}
if bbs.valueBuffer.Len() >= bbs.GetPeriod() {
bbs.valueBuffer.Dequeue()
}
px, py :... | [
"func",
"(",
"bbs",
"*",
"BollingerBandsSeries",
")",
"GetBoundedValues",
"(",
"index",
"int",
")",
"(",
"x",
",",
"y1",
",",
"y2",
"float64",
")",
"{",
"if",
"bbs",
".",
"InnerSeries",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"if",
"bbs",
".",
... | // GetBoundedValues gets the bounded value for the series. | [
"GetBoundedValues",
"gets",
"the",
"bounded",
"value",
"for",
"the",
"series",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/bollinger_band_series.go#L70-L90 |
25,663 | wcharczuk/go-chart | bollinger_band_series.go | GetBoundedLastValues | func (bbs *BollingerBandsSeries) GetBoundedLastValues() (x, y1, y2 float64) {
if bbs.InnerSeries == nil {
return
}
period := bbs.GetPeriod()
seriesLength := bbs.InnerSeries.Len()
startAt := seriesLength - period
if startAt < 0 {
startAt = 0
}
vb := seq.NewBufferWithCapacity(period)
for index := startAt; i... | go | func (bbs *BollingerBandsSeries) GetBoundedLastValues() (x, y1, y2 float64) {
if bbs.InnerSeries == nil {
return
}
period := bbs.GetPeriod()
seriesLength := bbs.InnerSeries.Len()
startAt := seriesLength - period
if startAt < 0 {
startAt = 0
}
vb := seq.NewBufferWithCapacity(period)
for index := startAt; i... | [
"func",
"(",
"bbs",
"*",
"BollingerBandsSeries",
")",
"GetBoundedLastValues",
"(",
")",
"(",
"x",
",",
"y1",
",",
"y2",
"float64",
")",
"{",
"if",
"bbs",
".",
"InnerSeries",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"period",
":=",
"bbs",
".",
"Ge... | // GetBoundedLastValues returns the last bounded value for the series. | [
"GetBoundedLastValues",
"returns",
"the",
"last",
"bounded",
"value",
"for",
"the",
"series",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/bollinger_band_series.go#L93-L118 |
25,664 | wcharczuk/go-chart | drawing/raster_graphic_context.go | NewRasterGraphicContext | func NewRasterGraphicContext(img draw.Image) (*RasterGraphicContext, error) {
var painter Painter
switch selectImage := img.(type) {
case *image.RGBA:
painter = raster.NewRGBAPainter(selectImage)
default:
return nil, errors.New("NewRasterGraphicContext() :: invalid image type")
}
return NewRasterGraphicContex... | go | func NewRasterGraphicContext(img draw.Image) (*RasterGraphicContext, error) {
var painter Painter
switch selectImage := img.(type) {
case *image.RGBA:
painter = raster.NewRGBAPainter(selectImage)
default:
return nil, errors.New("NewRasterGraphicContext() :: invalid image type")
}
return NewRasterGraphicContex... | [
"func",
"NewRasterGraphicContext",
"(",
"img",
"draw",
".",
"Image",
")",
"(",
"*",
"RasterGraphicContext",
",",
"error",
")",
"{",
"var",
"painter",
"Painter",
"\n",
"switch",
"selectImage",
":=",
"img",
".",
"(",
"type",
")",
"{",
"case",
"*",
"image",
... | // NewRasterGraphicContext creates a new Graphic context from an image. | [
"NewRasterGraphicContext",
"creates",
"a",
"new",
"Graphic",
"context",
"from",
"an",
"image",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/raster_graphic_context.go#L17-L26 |
25,665 | wcharczuk/go-chart | drawing/raster_graphic_context.go | SetDPI | func (rgc *RasterGraphicContext) SetDPI(dpi float64) {
rgc.DPI = dpi
rgc.recalc()
} | go | func (rgc *RasterGraphicContext) SetDPI(dpi float64) {
rgc.DPI = dpi
rgc.recalc()
} | [
"func",
"(",
"rgc",
"*",
"RasterGraphicContext",
")",
"SetDPI",
"(",
"dpi",
"float64",
")",
"{",
"rgc",
".",
"DPI",
"=",
"dpi",
"\n",
"rgc",
".",
"recalc",
"(",
")",
"\n",
"}"
] | // SetDPI sets the screen resolution in dots per inch. | [
"SetDPI",
"sets",
"the",
"screen",
"resolution",
"in",
"dots",
"per",
"inch",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/raster_graphic_context.go#L54-L57 |
25,666 | wcharczuk/go-chart | drawing/raster_graphic_context.go | Clear | func (rgc *RasterGraphicContext) Clear() {
width, height := rgc.img.Bounds().Dx(), rgc.img.Bounds().Dy()
rgc.ClearRect(0, 0, width, height)
} | go | func (rgc *RasterGraphicContext) Clear() {
width, height := rgc.img.Bounds().Dx(), rgc.img.Bounds().Dy()
rgc.ClearRect(0, 0, width, height)
} | [
"func",
"(",
"rgc",
"*",
"RasterGraphicContext",
")",
"Clear",
"(",
")",
"{",
"width",
",",
"height",
":=",
"rgc",
".",
"img",
".",
"Bounds",
"(",
")",
".",
"Dx",
"(",
")",
",",
"rgc",
".",
"img",
".",
"Bounds",
"(",
")",
".",
"Dy",
"(",
")",
... | // Clear fills the current canvas with a default transparent color | [
"Clear",
"fills",
"the",
"current",
"canvas",
"with",
"a",
"default",
"transparent",
"color"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/raster_graphic_context.go#L65-L68 |
25,667 | wcharczuk/go-chart | drawing/raster_graphic_context.go | ClearRect | func (rgc *RasterGraphicContext) ClearRect(x1, y1, x2, y2 int) {
imageColor := image.NewUniform(rgc.current.FillColor)
draw.Draw(rgc.img, image.Rect(x1, y1, x2, y2), imageColor, image.ZP, draw.Over)
} | go | func (rgc *RasterGraphicContext) ClearRect(x1, y1, x2, y2 int) {
imageColor := image.NewUniform(rgc.current.FillColor)
draw.Draw(rgc.img, image.Rect(x1, y1, x2, y2), imageColor, image.ZP, draw.Over)
} | [
"func",
"(",
"rgc",
"*",
"RasterGraphicContext",
")",
"ClearRect",
"(",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
"int",
")",
"{",
"imageColor",
":=",
"image",
".",
"NewUniform",
"(",
"rgc",
".",
"current",
".",
"FillColor",
")",
"\n",
"draw",
".",
"Dra... | // ClearRect fills the current canvas with a default transparent color at the specified rectangle | [
"ClearRect",
"fills",
"the",
"current",
"canvas",
"with",
"a",
"default",
"transparent",
"color",
"at",
"the",
"specified",
"rectangle"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/raster_graphic_context.go#L71-L74 |
25,668 | wcharczuk/go-chart | drawing/raster_graphic_context.go | DrawImage | func (rgc *RasterGraphicContext) DrawImage(img image.Image) {
DrawImage(img, rgc.img, rgc.current.Tr, draw.Over, BilinearFilter)
} | go | func (rgc *RasterGraphicContext) DrawImage(img image.Image) {
DrawImage(img, rgc.img, rgc.current.Tr, draw.Over, BilinearFilter)
} | [
"func",
"(",
"rgc",
"*",
"RasterGraphicContext",
")",
"DrawImage",
"(",
"img",
"image",
".",
"Image",
")",
"{",
"DrawImage",
"(",
"img",
",",
"rgc",
".",
"img",
",",
"rgc",
".",
"current",
".",
"Tr",
",",
"draw",
".",
"Over",
",",
"BilinearFilter",
"... | // DrawImage draws the raster image in the current canvas | [
"DrawImage",
"draws",
"the",
"raster",
"image",
"in",
"the",
"current",
"canvas"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/raster_graphic_context.go#L77-L79 |
25,669 | wcharczuk/go-chart | drawing/raster_graphic_context.go | CreateStringPath | func (rgc *RasterGraphicContext) CreateStringPath(s string, x, y float64) (cursor float64, err error) {
f := rgc.GetFont()
if f == nil {
err = errors.New("No font loaded, cannot continue")
return
}
rgc.recalc()
startx := x
prev, hasPrev := truetype.Index(0), false
for _, rc := range s {
index := f.Index(r... | go | func (rgc *RasterGraphicContext) CreateStringPath(s string, x, y float64) (cursor float64, err error) {
f := rgc.GetFont()
if f == nil {
err = errors.New("No font loaded, cannot continue")
return
}
rgc.recalc()
startx := x
prev, hasPrev := truetype.Index(0), false
for _, rc := range s {
index := f.Index(r... | [
"func",
"(",
"rgc",
"*",
"RasterGraphicContext",
")",
"CreateStringPath",
"(",
"s",
"string",
",",
"x",
",",
"y",
"float64",
")",
"(",
"cursor",
"float64",
",",
"err",
"error",
")",
"{",
"f",
":=",
"rgc",
".",
"GetFont",
"(",
")",
"\n",
"if",
"f",
... | // CreateStringPath creates a path from the string s at x, y, and returns the string width.
// The text is placed so that the left edge of the em square of the first character of s
// and the baseline intersect at x, y. The majority of the affected pixels will be
// above and to the right of the point, but some may be ... | [
"CreateStringPath",
"creates",
"a",
"path",
"from",
"the",
"string",
"s",
"at",
"x",
"y",
"and",
"returns",
"the",
"string",
"width",
".",
"The",
"text",
"is",
"placed",
"so",
"that",
"the",
"left",
"edge",
"of",
"the",
"em",
"square",
"of",
"the",
"fi... | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/raster_graphic_context.go#L125-L150 |
25,670 | wcharczuk/go-chart | drawing/raster_graphic_context.go | GetStringBounds | func (rgc *RasterGraphicContext) GetStringBounds(s string) (left, top, right, bottom float64, err error) {
f := rgc.GetFont()
if f == nil {
err = errors.New("No font loaded, cannot continue")
return
}
rgc.recalc()
left = math.MaxFloat64
top = math.MaxFloat64
cursor := 0.0
prev, hasPrev := truetype.Index(0... | go | func (rgc *RasterGraphicContext) GetStringBounds(s string) (left, top, right, bottom float64, err error) {
f := rgc.GetFont()
if f == nil {
err = errors.New("No font loaded, cannot continue")
return
}
rgc.recalc()
left = math.MaxFloat64
top = math.MaxFloat64
cursor := 0.0
prev, hasPrev := truetype.Index(0... | [
"func",
"(",
"rgc",
"*",
"RasterGraphicContext",
")",
"GetStringBounds",
"(",
"s",
"string",
")",
"(",
"left",
",",
"top",
",",
"right",
",",
"bottom",
"float64",
",",
"err",
"error",
")",
"{",
"f",
":=",
"rgc",
".",
"GetFont",
"(",
")",
"\n",
"if",
... | // GetStringBounds returns the approximate pixel bounds of a string. | [
"GetStringBounds",
"returns",
"the",
"approximate",
"pixel",
"bounds",
"of",
"a",
"string",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/raster_graphic_context.go#L153-L191 |
25,671 | wcharczuk/go-chart | drawing/raster_graphic_context.go | recalc | func (rgc *RasterGraphicContext) recalc() {
rgc.current.Scale = rgc.current.FontSizePoints * float64(rgc.DPI)
} | go | func (rgc *RasterGraphicContext) recalc() {
rgc.current.Scale = rgc.current.FontSizePoints * float64(rgc.DPI)
} | [
"func",
"(",
"rgc",
"*",
"RasterGraphicContext",
")",
"recalc",
"(",
")",
"{",
"rgc",
".",
"current",
".",
"Scale",
"=",
"rgc",
".",
"current",
".",
"FontSizePoints",
"*",
"float64",
"(",
"rgc",
".",
"DPI",
")",
"\n",
"}"
] | // recalc recalculates scale and bounds values from the font size, screen
// resolution and font metrics, and invalidates the glyph cache. | [
"recalc",
"recalculates",
"scale",
"and",
"bounds",
"values",
"from",
"the",
"font",
"size",
"screen",
"resolution",
"and",
"font",
"metrics",
"and",
"invalidates",
"the",
"glyph",
"cache",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/raster_graphic_context.go#L195-L197 |
25,672 | wcharczuk/go-chart | drawing/raster_graphic_context.go | SetFont | func (rgc *RasterGraphicContext) SetFont(font *truetype.Font) {
rgc.current.Font = font
} | go | func (rgc *RasterGraphicContext) SetFont(font *truetype.Font) {
rgc.current.Font = font
} | [
"func",
"(",
"rgc",
"*",
"RasterGraphicContext",
")",
"SetFont",
"(",
"font",
"*",
"truetype",
".",
"Font",
")",
"{",
"rgc",
".",
"current",
".",
"Font",
"=",
"font",
"\n",
"}"
] | // SetFont sets the font used to draw text. | [
"SetFont",
"sets",
"the",
"font",
"used",
"to",
"draw",
"text",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/raster_graphic_context.go#L200-L202 |
25,673 | wcharczuk/go-chart | drawing/raster_graphic_context.go | Stroke | func (rgc *RasterGraphicContext) Stroke(paths ...*Path) {
paths = append(paths, rgc.current.Path)
rgc.strokeRasterizer.UseNonZeroWinding = true
stroker := NewLineStroker(rgc.current.Cap, rgc.current.Join, Transformer{Tr: rgc.current.Tr, Flattener: FtLineBuilder{Adder: rgc.strokeRasterizer}})
stroker.HalfLineWidth ... | go | func (rgc *RasterGraphicContext) Stroke(paths ...*Path) {
paths = append(paths, rgc.current.Path)
rgc.strokeRasterizer.UseNonZeroWinding = true
stroker := NewLineStroker(rgc.current.Cap, rgc.current.Join, Transformer{Tr: rgc.current.Tr, Flattener: FtLineBuilder{Adder: rgc.strokeRasterizer}})
stroker.HalfLineWidth ... | [
"func",
"(",
"rgc",
"*",
"RasterGraphicContext",
")",
"Stroke",
"(",
"paths",
"...",
"*",
"Path",
")",
"{",
"paths",
"=",
"append",
"(",
"paths",
",",
"rgc",
".",
"current",
".",
"Path",
")",
"\n",
"rgc",
".",
"strokeRasterizer",
".",
"UseNonZeroWinding"... | // Stroke strokes the paths with the color specified by SetStrokeColor | [
"Stroke",
"strokes",
"the",
"paths",
"with",
"the",
"color",
"specified",
"by",
"SetStrokeColor"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/raster_graphic_context.go#L223-L241 |
25,674 | wcharczuk/go-chart | drawing/raster_graphic_context.go | Fill | func (rgc *RasterGraphicContext) Fill(paths ...*Path) {
paths = append(paths, rgc.current.Path)
rgc.fillRasterizer.UseNonZeroWinding = rgc.current.FillRule == FillRuleWinding
flattener := Transformer{Tr: rgc.current.Tr, Flattener: FtLineBuilder{Adder: rgc.fillRasterizer}}
for _, p := range paths {
Flatten(p, fla... | go | func (rgc *RasterGraphicContext) Fill(paths ...*Path) {
paths = append(paths, rgc.current.Path)
rgc.fillRasterizer.UseNonZeroWinding = rgc.current.FillRule == FillRuleWinding
flattener := Transformer{Tr: rgc.current.Tr, Flattener: FtLineBuilder{Adder: rgc.fillRasterizer}}
for _, p := range paths {
Flatten(p, fla... | [
"func",
"(",
"rgc",
"*",
"RasterGraphicContext",
")",
"Fill",
"(",
"paths",
"...",
"*",
"Path",
")",
"{",
"paths",
"=",
"append",
"(",
"paths",
",",
"rgc",
".",
"current",
".",
"Path",
")",
"\n",
"rgc",
".",
"fillRasterizer",
".",
"UseNonZeroWinding",
... | // Fill fills the paths with the color specified by SetFillColor | [
"Fill",
"fills",
"the",
"paths",
"with",
"the",
"color",
"specified",
"by",
"SetFillColor"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/raster_graphic_context.go#L244-L254 |
25,675 | wcharczuk/go-chart | drawing/raster_graphic_context.go | FillStroke | func (rgc *RasterGraphicContext) FillStroke(paths ...*Path) {
paths = append(paths, rgc.current.Path)
rgc.fillRasterizer.UseNonZeroWinding = rgc.current.FillRule == FillRuleWinding
rgc.strokeRasterizer.UseNonZeroWinding = true
flattener := Transformer{Tr: rgc.current.Tr, Flattener: FtLineBuilder{Adder: rgc.fillRas... | go | func (rgc *RasterGraphicContext) FillStroke(paths ...*Path) {
paths = append(paths, rgc.current.Path)
rgc.fillRasterizer.UseNonZeroWinding = rgc.current.FillRule == FillRuleWinding
rgc.strokeRasterizer.UseNonZeroWinding = true
flattener := Transformer{Tr: rgc.current.Tr, Flattener: FtLineBuilder{Adder: rgc.fillRas... | [
"func",
"(",
"rgc",
"*",
"RasterGraphicContext",
")",
"FillStroke",
"(",
"paths",
"...",
"*",
"Path",
")",
"{",
"paths",
"=",
"append",
"(",
"paths",
",",
"rgc",
".",
"current",
".",
"Path",
")",
"\n",
"rgc",
".",
"fillRasterizer",
".",
"UseNonZeroWindin... | // FillStroke first fills the paths and than strokes them | [
"FillStroke",
"first",
"fills",
"the",
"paths",
"and",
"than",
"strokes",
"them"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/raster_graphic_context.go#L257-L283 |
25,676 | wcharczuk/go-chart | seq/times.go | GetValue | func (t Times) GetValue(index int) float64 {
return util.Time.ToFloat64(t[index])
} | go | func (t Times) GetValue(index int) float64 {
return util.Time.ToFloat64(t[index])
} | [
"func",
"(",
"t",
"Times",
")",
"GetValue",
"(",
"index",
"int",
")",
"float64",
"{",
"return",
"util",
".",
"Time",
".",
"ToFloat64",
"(",
"t",
"[",
"index",
"]",
")",
"\n",
"}"
] | // GetValue returns a value at an index as a time. | [
"GetValue",
"returns",
"a",
"value",
"at",
"an",
"index",
"as",
"a",
"time",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/times.go#L29-L31 |
25,677 | wcharczuk/go-chart | drawing/curve.go | SubdivideCubic | func SubdivideCubic(c, c1, c2 []float64) {
// First point of c is the first point of c1
c1[0], c1[1] = c[0], c[1]
// Last point of c is the last point of c2
c2[6], c2[7] = c[6], c[7]
// Subdivide segment using midpoints
c1[2] = (c[0] + c[2]) / 2
c1[3] = (c[1] + c[3]) / 2
midX := (c[2] + c[4]) / 2
midY := (c[... | go | func SubdivideCubic(c, c1, c2 []float64) {
// First point of c is the first point of c1
c1[0], c1[1] = c[0], c[1]
// Last point of c is the last point of c2
c2[6], c2[7] = c[6], c[7]
// Subdivide segment using midpoints
c1[2] = (c[0] + c[2]) / 2
c1[3] = (c[1] + c[3]) / 2
midX := (c[2] + c[4]) / 2
midY := (c[... | [
"func",
"SubdivideCubic",
"(",
"c",
",",
"c1",
",",
"c2",
"[",
"]",
"float64",
")",
"{",
"// First point of c is the first point of c1",
"c1",
"[",
"0",
"]",
",",
"c1",
"[",
"1",
"]",
"=",
"c",
"[",
"0",
"]",
",",
"c",
"[",
"1",
"]",
"\n",
"// Last... | // Cubic
// x1, y1, cpx1, cpy1, cpx2, cpy2, x2, y2 float64
// SubdivideCubic a Bezier cubic curve in 2 equivalents Bezier cubic curves.
// c1 and c2 parameters are the resulting curves | [
"Cubic",
"x1",
"y1",
"cpx1",
"cpy1",
"cpx2",
"cpy2",
"x2",
"y2",
"float64",
"SubdivideCubic",
"a",
"Bezier",
"cubic",
"curve",
"in",
"2",
"equivalents",
"Bezier",
"cubic",
"curves",
".",
"c1",
"and",
"c2",
"parameters",
"are",
"the",
"resulting",
"curves"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/curve.go#L15-L42 |
25,678 | wcharczuk/go-chart | drawing/curve.go | TraceCubic | func TraceCubic(t Liner, cubic []float64, flatteningThreshold float64) {
// Allocation curves
var curves [CurveRecursionLimit * 8]float64
copy(curves[0:8], cubic[0:8])
i := 0
// current curve
var c []float64
var dx, dy, d2, d3 float64
for i >= 0 {
c = curves[i*8:]
dx = c[6] - c[0]
dy = c[7] - c[1]
d... | go | func TraceCubic(t Liner, cubic []float64, flatteningThreshold float64) {
// Allocation curves
var curves [CurveRecursionLimit * 8]float64
copy(curves[0:8], cubic[0:8])
i := 0
// current curve
var c []float64
var dx, dy, d2, d3 float64
for i >= 0 {
c = curves[i*8:]
dx = c[6] - c[0]
dy = c[7] - c[1]
d... | [
"func",
"TraceCubic",
"(",
"t",
"Liner",
",",
"cubic",
"[",
"]",
"float64",
",",
"flatteningThreshold",
"float64",
")",
"{",
"// Allocation curves",
"var",
"curves",
"[",
"CurveRecursionLimit",
"*",
"8",
"]",
"float64",
"\n",
"copy",
"(",
"curves",
"[",
"0",... | // TraceCubic generate lines subdividing the cubic curve using a Liner
// flattening_threshold helps determines the flattening expectation of the curve | [
"TraceCubic",
"generate",
"lines",
"subdividing",
"the",
"cubic",
"curve",
"using",
"a",
"Liner",
"flattening_threshold",
"helps",
"determines",
"the",
"flattening",
"expectation",
"of",
"the",
"curve"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/curve.go#L46-L75 |
25,679 | wcharczuk/go-chart | drawing/curve.go | SubdivideQuad | func SubdivideQuad(c, c1, c2 []float64) {
// First point of c is the first point of c1
c1[0], c1[1] = c[0], c[1]
// Last point of c is the last point of c2
c2[4], c2[5] = c[4], c[5]
// Subdivide segment using midpoints
c1[2] = (c[0] + c[2]) / 2
c1[3] = (c[1] + c[3]) / 2
c2[2] = (c[2] + c[4]) / 2
c2[3] = (c[3]... | go | func SubdivideQuad(c, c1, c2 []float64) {
// First point of c is the first point of c1
c1[0], c1[1] = c[0], c[1]
// Last point of c is the last point of c2
c2[4], c2[5] = c[4], c[5]
// Subdivide segment using midpoints
c1[2] = (c[0] + c[2]) / 2
c1[3] = (c[1] + c[3]) / 2
c2[2] = (c[2] + c[4]) / 2
c2[3] = (c[3]... | [
"func",
"SubdivideQuad",
"(",
"c",
",",
"c1",
",",
"c2",
"[",
"]",
"float64",
")",
"{",
"// First point of c is the first point of c1",
"c1",
"[",
"0",
"]",
",",
"c1",
"[",
"1",
"]",
"=",
"c",
"[",
"0",
"]",
",",
"c",
"[",
"1",
"]",
"\n",
"// Last ... | // Quad
// x1, y1, cpx1, cpy2, x2, y2 float64
// SubdivideQuad a Bezier quad curve in 2 equivalents Bezier quad curves.
// c1 and c2 parameters are the resulting curves | [
"Quad",
"x1",
"y1",
"cpx1",
"cpy2",
"x2",
"y2",
"float64",
"SubdivideQuad",
"a",
"Bezier",
"quad",
"curve",
"in",
"2",
"equivalents",
"Bezier",
"quad",
"curves",
".",
"c1",
"and",
"c2",
"parameters",
"are",
"the",
"resulting",
"curves"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/curve.go#L82-L97 |
25,680 | wcharczuk/go-chart | drawing/curve.go | TraceQuad | func TraceQuad(t Liner, quad []float64, flatteningThreshold float64) {
const curveLen = CurveRecursionLimit * 6
const curveEndIndex = curveLen - 1
const lastIteration = CurveRecursionLimit - 1
// Allocates curves stack
curves := make([]float64, curveLen)
// copy 6 elements from the quad path to the stack
copy(... | go | func TraceQuad(t Liner, quad []float64, flatteningThreshold float64) {
const curveLen = CurveRecursionLimit * 6
const curveEndIndex = curveLen - 1
const lastIteration = CurveRecursionLimit - 1
// Allocates curves stack
curves := make([]float64, curveLen)
// copy 6 elements from the quad path to the stack
copy(... | [
"func",
"TraceQuad",
"(",
"t",
"Liner",
",",
"quad",
"[",
"]",
"float64",
",",
"flatteningThreshold",
"float64",
")",
"{",
"const",
"curveLen",
"=",
"CurveRecursionLimit",
"*",
"6",
"\n",
"const",
"curveEndIndex",
"=",
"curveLen",
"-",
"1",
"\n",
"const",
... | // TraceQuad generate lines subdividing the curve using a Liner
// flattening_threshold helps determines the flattening expectation of the curve | [
"TraceQuad",
"generate",
"lines",
"subdividing",
"the",
"curve",
"using",
"a",
"Liner",
"flattening_threshold",
"helps",
"determines",
"the",
"flattening",
"expectation",
"of",
"the",
"curve"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/curve.go#L123-L156 |
25,681 | wcharczuk/go-chart | seq/linear.go | Range | func Range(start, end float64) []float64 {
return Seq{NewLinear().WithStart(start).WithEnd(end).WithStep(1.0)}.Array()
} | go | func Range(start, end float64) []float64 {
return Seq{NewLinear().WithStart(start).WithEnd(end).WithStep(1.0)}.Array()
} | [
"func",
"Range",
"(",
"start",
",",
"end",
"float64",
")",
"[",
"]",
"float64",
"{",
"return",
"Seq",
"{",
"NewLinear",
"(",
")",
".",
"WithStart",
"(",
"start",
")",
".",
"WithEnd",
"(",
"end",
")",
".",
"WithStep",
"(",
"1.0",
")",
"}",
".",
"A... | // Range returns the array values of a linear seq with a given start, end and optional step. | [
"Range",
"returns",
"the",
"array",
"values",
"of",
"a",
"linear",
"seq",
"with",
"a",
"given",
"start",
"end",
"and",
"optional",
"step",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/linear.go#L4-L6 |
25,682 | wcharczuk/go-chart | seq/linear.go | RangeWithStep | func RangeWithStep(start, end, step float64) []float64 {
return Seq{NewLinear().WithStart(start).WithEnd(end).WithStep(step)}.Array()
} | go | func RangeWithStep(start, end, step float64) []float64 {
return Seq{NewLinear().WithStart(start).WithEnd(end).WithStep(step)}.Array()
} | [
"func",
"RangeWithStep",
"(",
"start",
",",
"end",
",",
"step",
"float64",
")",
"[",
"]",
"float64",
"{",
"return",
"Seq",
"{",
"NewLinear",
"(",
")",
".",
"WithStart",
"(",
"start",
")",
".",
"WithEnd",
"(",
"end",
")",
".",
"WithStep",
"(",
"step",... | // RangeWithStep returns the array values of a linear seq with a given start, end and optional step. | [
"RangeWithStep",
"returns",
"the",
"array",
"values",
"of",
"a",
"linear",
"seq",
"with",
"a",
"given",
"start",
"end",
"and",
"optional",
"step",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/linear.go#L9-L11 |
25,683 | wcharczuk/go-chart | seq/linear.go | Len | func (lg Linear) Len() int {
if lg.start < lg.end {
return int((lg.end-lg.start)/lg.step) + 1
}
return int((lg.start-lg.end)/lg.step) + 1
} | go | func (lg Linear) Len() int {
if lg.start < lg.end {
return int((lg.end-lg.start)/lg.step) + 1
}
return int((lg.start-lg.end)/lg.step) + 1
} | [
"func",
"(",
"lg",
"Linear",
")",
"Len",
"(",
")",
"int",
"{",
"if",
"lg",
".",
"start",
"<",
"lg",
".",
"end",
"{",
"return",
"int",
"(",
"(",
"lg",
".",
"end",
"-",
"lg",
".",
"start",
")",
"/",
"lg",
".",
"step",
")",
"+",
"1",
"\n",
"... | // Len returns the number of elements in the seq. | [
"Len",
"returns",
"the",
"number",
"of",
"elements",
"in",
"the",
"seq",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/linear.go#L41-L46 |
25,684 | wcharczuk/go-chart | seq/linear.go | GetValue | func (lg Linear) GetValue(index int) float64 {
fi := float64(index)
if lg.start < lg.end {
return lg.start + (fi * lg.step)
}
return lg.start - (fi * lg.step)
} | go | func (lg Linear) GetValue(index int) float64 {
fi := float64(index)
if lg.start < lg.end {
return lg.start + (fi * lg.step)
}
return lg.start - (fi * lg.step)
} | [
"func",
"(",
"lg",
"Linear",
")",
"GetValue",
"(",
"index",
"int",
")",
"float64",
"{",
"fi",
":=",
"float64",
"(",
"index",
")",
"\n",
"if",
"lg",
".",
"start",
"<",
"lg",
".",
"end",
"{",
"return",
"lg",
".",
"start",
"+",
"(",
"fi",
"*",
"lg... | // GetValue returns the value at a given index. | [
"GetValue",
"returns",
"the",
"value",
"at",
"a",
"given",
"index",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/linear.go#L49-L55 |
25,685 | wcharczuk/go-chart | seq/linear.go | WithStart | func (lg *Linear) WithStart(start float64) *Linear {
lg.start = start
return lg
} | go | func (lg *Linear) WithStart(start float64) *Linear {
lg.start = start
return lg
} | [
"func",
"(",
"lg",
"*",
"Linear",
")",
"WithStart",
"(",
"start",
"float64",
")",
"*",
"Linear",
"{",
"lg",
".",
"start",
"=",
"start",
"\n",
"return",
"lg",
"\n",
"}"
] | // WithStart sets the start and returns the linear generator. | [
"WithStart",
"sets",
"the",
"start",
"and",
"returns",
"the",
"linear",
"generator",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/linear.go#L58-L61 |
25,686 | wcharczuk/go-chart | seq/linear.go | WithEnd | func (lg *Linear) WithEnd(end float64) *Linear {
lg.end = end
return lg
} | go | func (lg *Linear) WithEnd(end float64) *Linear {
lg.end = end
return lg
} | [
"func",
"(",
"lg",
"*",
"Linear",
")",
"WithEnd",
"(",
"end",
"float64",
")",
"*",
"Linear",
"{",
"lg",
".",
"end",
"=",
"end",
"\n",
"return",
"lg",
"\n",
"}"
] | // WithEnd sets the end and returns the linear generator. | [
"WithEnd",
"sets",
"the",
"end",
"and",
"returns",
"the",
"linear",
"generator",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/linear.go#L64-L67 |
25,687 | wcharczuk/go-chart | seq/linear.go | WithStep | func (lg *Linear) WithStep(step float64) *Linear {
lg.step = step
return lg
} | go | func (lg *Linear) WithStep(step float64) *Linear {
lg.step = step
return lg
} | [
"func",
"(",
"lg",
"*",
"Linear",
")",
"WithStep",
"(",
"step",
"float64",
")",
"*",
"Linear",
"{",
"lg",
".",
"step",
"=",
"step",
"\n",
"return",
"lg",
"\n",
"}"
] | // WithStep sets the step and returns the linear generator. | [
"WithStep",
"sets",
"the",
"step",
"and",
"returns",
"the",
"linear",
"generator",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/seq/linear.go#L70-L73 |
25,688 | wcharczuk/go-chart | ema_series.go | GetFirstValues | func (ema *EMASeries) GetFirstValues() (x, y float64) {
if ema.InnerSeries == nil {
return
}
if len(ema.cache) == 0 {
ema.ensureCachedValues()
}
x, _ = ema.InnerSeries.GetValues(0)
y = ema.cache[0]
return
} | go | func (ema *EMASeries) GetFirstValues() (x, y float64) {
if ema.InnerSeries == nil {
return
}
if len(ema.cache) == 0 {
ema.ensureCachedValues()
}
x, _ = ema.InnerSeries.GetValues(0)
y = ema.cache[0]
return
} | [
"func",
"(",
"ema",
"*",
"EMASeries",
")",
"GetFirstValues",
"(",
")",
"(",
"x",
",",
"y",
"float64",
")",
"{",
"if",
"ema",
".",
"InnerSeries",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"if",
"len",
"(",
"ema",
".",
"cache",
")",
"==",
"0",
... | // GetFirstValues computes the first moving average value. | [
"GetFirstValues",
"computes",
"the",
"first",
"moving",
"average",
"value",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/ema_series.go#L77-L87 |
25,689 | wcharczuk/go-chart | concat_series.go | Len | func (cs ConcatSeries) Len() int {
total := 0
for _, s := range cs {
if typed, isValuesProvider := s.(ValuesProvider); isValuesProvider {
total += typed.Len()
}
}
return total
} | go | func (cs ConcatSeries) Len() int {
total := 0
for _, s := range cs {
if typed, isValuesProvider := s.(ValuesProvider); isValuesProvider {
total += typed.Len()
}
}
return total
} | [
"func",
"(",
"cs",
"ConcatSeries",
")",
"Len",
"(",
")",
"int",
"{",
"total",
":=",
"0",
"\n",
"for",
"_",
",",
"s",
":=",
"range",
"cs",
"{",
"if",
"typed",
",",
"isValuesProvider",
":=",
"s",
".",
"(",
"ValuesProvider",
")",
";",
"isValuesProvider"... | // Len returns the length of the concatenated set of series. | [
"Len",
"returns",
"the",
"length",
"of",
"the",
"concatenated",
"set",
"of",
"series",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/concat_series.go#L7-L16 |
25,690 | wcharczuk/go-chart | drawing/stack_graphic_context.go | NewStackGraphicContext | func NewStackGraphicContext() *StackGraphicContext {
gc := &StackGraphicContext{}
gc.current = new(ContextStack)
gc.current.Tr = NewIdentityMatrix()
gc.current.Path = new(Path)
gc.current.LineWidth = 1.0
gc.current.StrokeColor = image.Black
gc.current.FillColor = image.White
gc.current.Cap = RoundCap
gc.curren... | go | func NewStackGraphicContext() *StackGraphicContext {
gc := &StackGraphicContext{}
gc.current = new(ContextStack)
gc.current.Tr = NewIdentityMatrix()
gc.current.Path = new(Path)
gc.current.LineWidth = 1.0
gc.current.StrokeColor = image.Black
gc.current.FillColor = image.White
gc.current.Cap = RoundCap
gc.curren... | [
"func",
"NewStackGraphicContext",
"(",
")",
"*",
"StackGraphicContext",
"{",
"gc",
":=",
"&",
"StackGraphicContext",
"{",
"}",
"\n",
"gc",
".",
"current",
"=",
"new",
"(",
"ContextStack",
")",
"\n",
"gc",
".",
"current",
".",
"Tr",
"=",
"NewIdentityMatrix",
... | // NewStackGraphicContext Create a new Graphic context from an image | [
"NewStackGraphicContext",
"Create",
"a",
"new",
"Graphic",
"context",
"from",
"an",
"image"
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/stack_graphic_context.go#L37-L50 |
25,691 | wcharczuk/go-chart | drawing/stack_graphic_context.go | ComposeMatrixTransform | func (gc *StackGraphicContext) ComposeMatrixTransform(tr Matrix) {
gc.current.Tr.Compose(tr)
} | go | func (gc *StackGraphicContext) ComposeMatrixTransform(tr Matrix) {
gc.current.Tr.Compose(tr)
} | [
"func",
"(",
"gc",
"*",
"StackGraphicContext",
")",
"ComposeMatrixTransform",
"(",
"tr",
"Matrix",
")",
"{",
"gc",
".",
"current",
".",
"Tr",
".",
"Compose",
"(",
"tr",
")",
"\n",
"}"
] | // ComposeMatrixTransform composes a transform into the current transform. | [
"ComposeMatrixTransform",
"composes",
"a",
"transform",
"into",
"the",
"current",
"transform",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/stack_graphic_context.go#L63-L65 |
25,692 | wcharczuk/go-chart | drawing/stack_graphic_context.go | Rotate | func (gc *StackGraphicContext) Rotate(angle float64) {
gc.current.Tr.Rotate(angle)
} | go | func (gc *StackGraphicContext) Rotate(angle float64) {
gc.current.Tr.Rotate(angle)
} | [
"func",
"(",
"gc",
"*",
"StackGraphicContext",
")",
"Rotate",
"(",
"angle",
"float64",
")",
"{",
"gc",
".",
"current",
".",
"Tr",
".",
"Rotate",
"(",
"angle",
")",
"\n",
"}"
] | // Rotate rotates the matrix transform by an angle in degrees. | [
"Rotate",
"rotates",
"the",
"matrix",
"transform",
"by",
"an",
"angle",
"in",
"degrees",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/stack_graphic_context.go#L68-L70 |
25,693 | wcharczuk/go-chart | drawing/stack_graphic_context.go | Translate | func (gc *StackGraphicContext) Translate(tx, ty float64) {
gc.current.Tr.Translate(tx, ty)
} | go | func (gc *StackGraphicContext) Translate(tx, ty float64) {
gc.current.Tr.Translate(tx, ty)
} | [
"func",
"(",
"gc",
"*",
"StackGraphicContext",
")",
"Translate",
"(",
"tx",
",",
"ty",
"float64",
")",
"{",
"gc",
".",
"current",
".",
"Tr",
".",
"Translate",
"(",
"tx",
",",
"ty",
")",
"\n",
"}"
] | // Translate translates a transform. | [
"Translate",
"translates",
"a",
"transform",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/stack_graphic_context.go#L73-L75 |
25,694 | wcharczuk/go-chart | drawing/stack_graphic_context.go | Scale | func (gc *StackGraphicContext) Scale(sx, sy float64) {
gc.current.Tr.Scale(sx, sy)
} | go | func (gc *StackGraphicContext) Scale(sx, sy float64) {
gc.current.Tr.Scale(sx, sy)
} | [
"func",
"(",
"gc",
"*",
"StackGraphicContext",
")",
"Scale",
"(",
"sx",
",",
"sy",
"float64",
")",
"{",
"gc",
".",
"current",
".",
"Tr",
".",
"Scale",
"(",
"sx",
",",
"sy",
")",
"\n",
"}"
] | // Scale scales a transform. | [
"Scale",
"scales",
"a",
"transform",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/stack_graphic_context.go#L78-L80 |
25,695 | wcharczuk/go-chart | drawing/stack_graphic_context.go | SetStrokeColor | func (gc *StackGraphicContext) SetStrokeColor(c color.Color) {
gc.current.StrokeColor = c
} | go | func (gc *StackGraphicContext) SetStrokeColor(c color.Color) {
gc.current.StrokeColor = c
} | [
"func",
"(",
"gc",
"*",
"StackGraphicContext",
")",
"SetStrokeColor",
"(",
"c",
"color",
".",
"Color",
")",
"{",
"gc",
".",
"current",
".",
"StrokeColor",
"=",
"c",
"\n",
"}"
] | // SetStrokeColor sets the stroke color. | [
"SetStrokeColor",
"sets",
"the",
"stroke",
"color",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/stack_graphic_context.go#L83-L85 |
25,696 | wcharczuk/go-chart | drawing/stack_graphic_context.go | SetFillColor | func (gc *StackGraphicContext) SetFillColor(c color.Color) {
gc.current.FillColor = c
} | go | func (gc *StackGraphicContext) SetFillColor(c color.Color) {
gc.current.FillColor = c
} | [
"func",
"(",
"gc",
"*",
"StackGraphicContext",
")",
"SetFillColor",
"(",
"c",
"color",
".",
"Color",
")",
"{",
"gc",
".",
"current",
".",
"FillColor",
"=",
"c",
"\n",
"}"
] | // SetFillColor sets the fill color. | [
"SetFillColor",
"sets",
"the",
"fill",
"color",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/stack_graphic_context.go#L88-L90 |
25,697 | wcharczuk/go-chart | drawing/stack_graphic_context.go | SetLineDash | func (gc *StackGraphicContext) SetLineDash(dash []float64, dashOffset float64) {
gc.current.Dash = dash
gc.current.DashOffset = dashOffset
} | go | func (gc *StackGraphicContext) SetLineDash(dash []float64, dashOffset float64) {
gc.current.Dash = dash
gc.current.DashOffset = dashOffset
} | [
"func",
"(",
"gc",
"*",
"StackGraphicContext",
")",
"SetLineDash",
"(",
"dash",
"[",
"]",
"float64",
",",
"dashOffset",
"float64",
")",
"{",
"gc",
".",
"current",
".",
"Dash",
"=",
"dash",
"\n",
"gc",
".",
"current",
".",
"DashOffset",
"=",
"dashOffset",... | // SetLineDash sets the line dash. | [
"SetLineDash",
"sets",
"the",
"line",
"dash",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/stack_graphic_context.go#L113-L116 |
25,698 | wcharczuk/go-chart | drawing/stack_graphic_context.go | SetFont | func (gc *StackGraphicContext) SetFont(f *truetype.Font) {
gc.current.Font = f
} | go | func (gc *StackGraphicContext) SetFont(f *truetype.Font) {
gc.current.Font = f
} | [
"func",
"(",
"gc",
"*",
"StackGraphicContext",
")",
"SetFont",
"(",
"f",
"*",
"truetype",
".",
"Font",
")",
"{",
"gc",
".",
"current",
".",
"Font",
"=",
"f",
"\n",
"}"
] | // SetFont sets the current font. | [
"SetFont",
"sets",
"the",
"current",
"font",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/stack_graphic_context.go#L129-L131 |
25,699 | wcharczuk/go-chart | drawing/stack_graphic_context.go | LastPoint | func (gc *StackGraphicContext) LastPoint() (x float64, y float64) {
return gc.current.Path.LastPoint()
} | go | func (gc *StackGraphicContext) LastPoint() (x float64, y float64) {
return gc.current.Path.LastPoint()
} | [
"func",
"(",
"gc",
"*",
"StackGraphicContext",
")",
"LastPoint",
"(",
")",
"(",
"x",
"float64",
",",
"y",
"float64",
")",
"{",
"return",
"gc",
".",
"current",
".",
"Path",
".",
"LastPoint",
"(",
")",
"\n",
"}"
] | // LastPoint returns the last point on the path. | [
"LastPoint",
"returns",
"the",
"last",
"point",
"on",
"the",
"path",
"."
] | 9852fce5a172598e72d16f4306f0f17a53d94eb4 | https://github.com/wcharczuk/go-chart/blob/9852fce5a172598e72d16f4306f0f17a53d94eb4/drawing/stack_graphic_context.go#L149-L151 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.