1
votes

I'm using google charts (in GWT with gwt-charts library) and I'm trying to change the line width of a candlestick chart to 1 but it is not working

I'm using ComboChart with series of type Candlestick and I've tried setting lineWidth to 1 for "options" and "series" object, with no luck.

Is it possible that lineWidth has no effect on candlestick types ?

Code:

ComboChart chart = new ComboChart();
ComboChartOptions options = ComboChartOptions.create(); 

Legend legend = Legend.create();
legend.setPosition(LegendPosition.NONE);
options.setLegend(legend);

ComboChartSeries series = ComboChartSeries.create();
series.setType(SeriesType.CANDLESTICK);
series.setLineWidth(1);
options.setSeries(series);
options.setLineWidth(1);


// draw on data update 
...
chart.draw(dataTable, options);
1
Can you post the relevant code ? - Ümit
Done. The Chart is visible and the update is ok, but the candlestick lines are 2 pixels thick (strokeWidth = 2) - Andrei F
AFAIK to change the strokeWith of the candlestick chart you have to use candlestick.risingColor.strokeWidth and candlestick.falingColor.strokeWidth instead of setLineWidth on the combochart. See here for more detials. - Ümit
It worked. Thank you kind sir! - Andrei F

1 Answers

0
votes

Unfortunatelly, candlestick.risingColor.strokeWidth and candlestick.falingColor.strokeWidth only affect the candle body. There is an enhancement request to customize shadows and wicks on https://github.com/google/google-visualization-issues/issues/1014 but the priority is low. If more users star this issue, Google team may speed up the solution.