' +
- 'open: | ' + chart.yAxis.tickFormat()(d.open) + ' |
' +
- 'close: | ' + chart.yAxis.tickFormat()(d.close) + ' |
' +
- 'high | ' + chart.yAxis.tickFormat()(d.high) + ' |
' +
- 'low: | ' + chart.yAxis.tickFormat()(d.low) + ' |
' +
- '
';
- });
- return chart;
-};
-
-// candlestickChart is just a historical chart with candlestick bars and some tweaks
-nv.models.candlestickBarChart = function() {
- var chart = nv.models.historicalBarChart(nv.models.candlestickBar());
-
- // special default tooltip since we show multiple values per x
- chart.useInteractiveGuideline(true);
- chart.interactiveLayer.tooltip.contentGenerator(function(data) {
- // we assume only one series exists for this chart
- var d = data.series[0].data;
- // match line colors as defined in nv.d3.css
- var color = d.open < d.close ? "2ca02c" : "d62728";
- return '' +
- '