admin管理员组文章数量:1353137
I have looked at the docs for bo charts and am able to reproduce a bar chart with a line as a different series. But how do I have a candlestick chart with a line as a different series?
When I try, I get the error Last domain does not have enough data columns (missing 3)
.
Yes, I am adjusting my datatable so it has the right number of variables (columns).
Date, Low, Open, High, Close, Average
I can create a candlestick bo chart with only one series when my data looks like:
Date, Low, Open, High, Close
What is happening when I add another column?
Update:
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Date', 'Low', 'Open', 'High', 'Close', 'Average'],
['2014/05', 200, 300, 500, 400, 350],
//...
]);
var options = {
seriesType: "candlesticks",
series: {
5: {type: "line"}
}
};
var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
I have looked at the docs for bo charts and am able to reproduce a bar chart with a line as a different series. But how do I have a candlestick chart with a line as a different series?
When I try, I get the error Last domain does not have enough data columns (missing 3)
.
Yes, I am adjusting my datatable so it has the right number of variables (columns).
Date, Low, Open, High, Close, Average
I can create a candlestick bo chart with only one series when my data looks like:
Date, Low, Open, High, Close
What is happening when I add another column?
Update:
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Date', 'Low', 'Open', 'High', 'Close', 'Average'],
['2014/05', 200, 300, 500, 400, 350],
//...
]);
var options = {
seriesType: "candlesticks",
series: {
5: {type: "line"}
}
};
var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
Share
Improve this question
edited Oct 5, 2014 at 18:51
brno792
asked Oct 2, 2014 at 20:07
brno792brno792
6,80918 gold badges57 silver badges72 bronze badges
1 Answer
Reset to default 9The "line" series is the 2nd data series, not the 6th, so your series option should be:
series: {
1: {
type: 'line'
}
}
本文标签: javascriptGoogle Chart ComboChart Candlesticks with LineStack Overflow
版权声明:本文标题:javascript - Google Chart ComboChart Candlesticks with Line - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743893780a2557410.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论