I'm trying to draw a CandleStick chart for a TeeChart JavaScript Version. However I only found the below demo. I'd like to find out how to add series(data) instead of using a addRandom() method. a addRandom() does not explain how to add a actual data.
I believe it could be something like this new Tee.Candle(open, high, low, close).
Please provide me a simple demo.
function draw() {
Chart1=new Tee.Chart("canvas");
Chart1.title.text="Candle OHLC";
var ohlc=new Tee.Candle();
Chart1.addSeries(ohlc).addRandom(20);
Chart1.draw();
}
Adding data to CandleChart(OHLC) for TeeChart(Javascript/HTM
Re: Adding data to CandleChart(OHLC) for TeeChart(Javascript/HTM
I forgot to add a date parameter.
I believe the function might be like this
-> new Tee.Candle(new Date(), open, high, low, close).
I believe the function might be like this
-> new Tee.Candle(new Date(), open, high, low, close).
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Adding data to CandleChart(OHLC) for TeeChart(Javascript/HTM
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Adding data to CandleChart(OHLC) for TeeChart(Javascript/HTM
Is there any way that I can add dates as bottom labels instead of index?
I put the date like the below code, but I can not use the tooltip once I put those dates as bottom labes.
I put the date like the below code, but I can not use the tooltip once I put those dates as bottom labes.
Code: Select all
var dates = [];
for(var i =0 ; i<json.length; i++){
ohlc.add(json[i].OPEN, json[i].CLOSE, json[i].HIGH, json[i].LOW);
dates.push(new Date(json[i].CHART_DATE));
}
Chart1.series.items[0].data.x = dates;
Chart1.axes.bottom.labels.dateFormat = "mm-dd-yyyy"
tip=new Tee.ToolTip(Chart1);
tip.ongettext=function(tool, text, series, index) {
if (tip.render=="dom"){
return 'Point: <strong>'+ index.toFixed(0) +'</strong><br/>Open: '+series.data.open[index].toFixed(2)+'<br/>High: '+series.data.high[index].toFixed(2)+'<br/>Low: '+series.data.low[index].toFixed(2)+'<br/>Close: '+series.data.close[index].toFixed(2);
}else{
return 'Point : '+ index.toFixed(0) +'\nOpen : '+series.data.open[index].toFixed(2) +'\nHigh : '+series.data.high[index].toFixed(2) +'\nLow : '+series.data.low[index].toFixed(2) +'\nClose : '+series.data.close[index].toFixed(2);
}
};
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Adding data to CandleChart(OHLC) for TeeChart(Javascript/HTM
Hello,
Did my last comment at StackOverflow help you solve the problem or do you still need help?
Thanks in advance.
Did my last comment at StackOverflow help you solve the problem or do you still need help?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |