We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Part of code
charts.WithItemStyleOpts(opts.ItemStyle{ Color: "#0F22C2", Color0: "#C2BA0F", BorderColor: "#0F22C2", BorderColor0: "#C2BA0F", BorderWidth: 4, }),
Full code below:-
func Kline(company string, data []dto.OHLC) string{ kline := charts.NewKLine() x := make([]string, 0) y := make([]opts.KlineData, 0) kd := ConvertOHLCtoKlineData(data) // Improvement: Uneccessary reverse order for i, j := 0, len(kd)-1; i < j; i, j = i+1, j-1 { kd[i], kd[j] = kd[j], kd[i] } for i := 0; i < len(kd); i++ { x = append(x, kd[i].Date) y = append(y, opts.KlineData{Value: kd[i].Data}) } kline.SetGlobalOptions( charts.WithTitleOpts(opts.Title{ Title: company, }), charts.WithXAxisOpts(opts.XAxis{ SplitNumber: 20, }), charts.WithYAxisOpts(opts.YAxis{ Scale: true, }), charts.WithDataZoomOpts(opts.DataZoom{ Type: "inside", Start: 50, End: 100, XAxisIndex: []int{0}, }), charts.WithDataZoomOpts(opts.DataZoom{ Type: "slider", Start: 50, End: 100, XAxisIndex: []int{0}, }), charts.WithTooltipOpts(opts.Tooltip{Show: true}), charts.WithLegendOpts(opts.Legend{Show: true, Right: "80px"}), ) kline.SetXAxis(x).AddSeries("kline", y). SetSeriesOptions( charts.WithMarkPointNameTypeItemOpts(opts.MarkPointNameTypeItem{ Name: "highest value", Type: "max", ValueDim: "highest", }), charts.WithMarkPointNameTypeItemOpts(opts.MarkPointNameTypeItem{ Name: "lowest value", Type: "min", ValueDim: "lowest", }), charts.WithMarkPointStyleOpts(opts.MarkPointStyle{ Label: &opts.Label{ Show: true, }, }), charts.WithItemStyleOpts(opts.ItemStyle{ Color: "#0F22C2", Color0: "#C2BA0F", BorderColor: "#0F22C2", BorderColor0: "#C2BA0F", BorderWidth: 4, }), ) kline.SetXAxis(x).AddSeries("kline", y) f, _ := os.Create("kline_all.html") kline.Render(f) var b bytes.Buffer err := kline.Render(&b) if err != nil { log.Fatal(err) } return b.String() }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
kline candlestick colors are not changing even though changing colors in WithItemStyleOpts option
Part of code
As you can see, border colors are changing but not color and color0, which represent inside colors
Full code below:-
The text was updated successfully, but these errors were encountered: