Skip to content

Instantly share code, notes, and snippets.

@thiyagu-p
thiyagu-p / ohlc.chart.js
Created October 21, 2012 05:23
OHLC with moving average and trading volume chart using d3
function OHLC(params) {
OHLC.prototype._init = function (params) {
this.height = params.height || 650;
this.width = params.width || 1300;
this.margin = params.margin || 50;
this.data = params.data;
this.movingAverageTypes = ['mov_avg_10d', 'mov_avg_50d', 'mov_avg_200d'];
this.dateFormat = d3.time.format("%Y-%m-%d");