Im trying to plot a candlestic chart for a stock.
But since its closed during weekends there is a gap in the chart
Is there a option im missing?? I want to remove the gap without loss of the dates.
This is the code:
google.charts.load('current', { 'packages': ['corechart'] });
google.charts.setOnLoadCallback(drawChart);
//Date, Low, Open, CLose, High, Col 5 [Optional]: A tooltip or style column for the candlestick
function drawChart() {
var data = google.visualization.arrayToDataTable(dps, true);
var options = {
legend: 'none',
colors: ['#000'],
candlestick: {
fallingColor: { strokeWidth: 0, fill: '#D32F2F' }, // red
risingColor: { strokeWidth: 0, fill: '#00796B' } // green
}
};
var chart = new google.visualization.CandlestickChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
Here is some test data:
var test = [
[new Date("2016-11-11"), 250.6, 250.9, 250.7, 254.4],
[new Date("2016-11-14"), 250.3, 252.8, 251.6, 257.9],
[new Date("2016-11-15"), 254.9, 255, 263.6, 263.8],
[new Date("2016-11-16"), 258.1, 264.3, 260.1, 264.3],
[new Date("2016-11-17"), 259.6, 260, 268.3, 268.9],
[new Date("2016-11-18"), 267.5, 268, 270.4, 272.3],
[new Date("2016-11-21"), 265.7, 271.2, 269.1, 271.5]
];