enter image description here 我想显示单个标志,而不是在Highstocks中显示多个标志(如果这一天有超过公司的公告)。如果我点击该标志,工具提示将逐个显示公告列表我可以点击每个公告都显示完整的公告
喜欢这个我想要的结果。任何人都可以帮助我。 http://investors.aflac.com/stock-information/interactive-chart.aspx
答案 0 :(得分:0)
flags
系列似乎未实现数据分组(尽管它存在于此类系列的API中)。它可以很容易编程:
现场演示: http://jsfiddle.net/kkulig/jmLnm4gk/
算法搜索具有相同x值的后续点并将它们合并为一个(创建组属性,稍后在工具提示中使用):
load: function() {
var series = this.series[1],
points = series.points,
group = [];
for (var i = points.length - 2; i >= 0; i--) {
var p = points[i],
nextP = points[i + 1]
// two points with same x values
if (p.x === nextP.x) {
// copy the group if it already exists in next point
if (nextP.group) {
p.group = nextP.group;
} else { // create a new group
p.group = [nextP.options];
}
// add point's options to its group
p.group.push(p.options);
// remove previous point
nextP.remove(false);
// change text displayed on flag
p.update({
title: 'Grouped flags'
}, false);
} // end of if
} // end of for
this.redraw();
} // end of function
(...)
plotOptions: {
flags: {
tooltip: {
pointFormatter: function() {
return this.group ? this.group.reduce((acc, val) => val.text + ' ' + acc, '') : this.text;
}
}
}
}
答案 1 :(得分:0)
在我的情况下它不起作用。
实际上我的图表看起来如下。enter image description here
因为每天所有新闻必须组合在一起,新的选择也必须基于它应该来的选择。我知道我需要分组。但是你可以告诉我如何组合在一起,在那个组中每个公告再次有可点击的顶部。请详细解释给我。