2

I want to change the color of the lines representing the low and high points of the candlestick. But when I try, both the falling and rising candles change to the same color. like this.

image

I want the falling and rising candles to have different colors. I searched the API documentation, but couldn't find an answer.

This is my hope

image

Here is my code

  const options = {
  legend: "none",
  candlestick: {
    fallingColor: { strokeWidth: 0, fill: "#f6465d" }, // red
    risingColor: { strokeWidth: 0, fill: "#0ccb80" }, // green
  },
  colors: ['#0ccb80'],
};

const data = [
  ["Day", "", "", "", ""],
  ["Mon", 20, 28, 38, 45],
  ["Tue", 31, 38, 55, 66],
  ["Wed", 50, 55, 77, 80],
  ["Thu", 77, 77, 66, 50],
  ["Fri", 68, 66, 22, 15],
  ["Sat", 42, 54, 60, 100],
  ["Sun", 34, 56, 64, 80],
];
Willie Cheng
  • 7,679
  • 13
  • 55
  • 68
code
  • 45
  • 5
  • 1
    Similar question: https://stackoverflow.com/questions/47641895/google-chart-candlestick-colors Changing candlestick lines color is not supported out-of-the box--see: https://github.com/google/google-visualization-issues/issues/1014 – user2314737 Jun 14 '22 at 09:06
  • any luck with this? I have been trying to figure it out as well. I think the solution will lie in finding a way to access the state of each candle. For instance this link https://developers.google.com/chart/interactive/docs/gallery/candlestickchart shows there are boolean options such as ```candlestick.hollowIsRising``` if I can find a way to get True/False returned then I can use that to change the color for each candle... maybe. – mdkb Jul 14 '22 at 06:43

0 Answers0