How to specify the color of candles.

TeeChart for Javascript for the HTML5 Canvas
Post Reply
twarpdev
Newbie
Newbie
Posts: 4
Joined: Wed Mar 13, 2013 12:00 am

How to specify the color of candles.

Post by twarpdev » Fri Nov 08, 2013 6:04 am

Is there any way to specify the colors of the candle?
I believe the candle has colors of green, white, red as a default setting.
I'd like to change those colors, and also can I remove a shadow of the candle?
Thank you in advance.

Marc
Site Admin
Site Admin
Posts: 925
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: How to specify the color of candles.

Post by Marc » Fri Nov 08, 2013 10:18 am

Hello,

Here's a sample snippet that shows options. At the moment the vertical stick pen colour needs to remain the same as the candlefill (unless you go into the teechart code to add a modification).

Code: Select all

function draw() {
  Chart1=new Tee.Chart("canvas");
  Chart1.title.text="Candle OHLC";
  
  var ohlc=new Tee.Candle();
  Chart1.addSeries(ohlc).addRandom(20);
 
  var hi=ohlc.higher;
  hi.fill="blue";
  hi.stroke.fill="lightgray";

  var lo=ohlc.lower;
  lo.fill="yellow";
  lo.stroke.fill="olive";
  
  ohlc.pointer.format.shadow.visible = false;

  Chart1.draw();
}
Regards,
Marc Meumann
Steema Support

Post Reply