Angularjs 单击蜘蛛网图表打开新图表了解详细信息
我想这样做:点击一个图表,我会在另一个spiderweb图表中显示详细信息,但当我在spiderweb图表链接中尝试该示例时,它没有起到任何帮助,请Angularjs 单击蜘蛛网图表打开新图表了解详细信息,angularjs,highcharts,Angularjs,Highcharts,我想这样做:点击一个图表,我会在另一个spiderweb图表中显示详细信息,但当我在spiderweb图表链接中尝试该示例时,它没有起到任何帮助,请 <highchart id="container" config="configChart" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></highchart> 这是我的密码: $scope.configChart =
<highchart id="container" config="configChart" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></highchart>
这是我的密码:
$scope.configChart = {
options: {
chart: {
polar: true,
type: 'line'
}
},
title: {
text: 'Dimensions result',
x: -80
},
pane: {
size: '80%'
},
xAxis: {
categories: [],
tickmarkPlacement: 'on',
lineWidth: 0
},
yAxis: {
gridLineInterpolation: 'polygon',
lineWidth: 0,
min: 0
},
tooltip: {
shared: true,
pointFormat: '<span style="color:{series.color}">{series.name}: <b>${point.y:,.0f}</b><br/>'
},
legend: {
align: 'right',
verticalAlign: 'top',
y: 70,
layout: 'vertical'
},
series: [{
name: 'Average',
data: [],
}]
};
<highchart id="container" config="configChart" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></highchart>
$scope.configChart={
选项:{
图表:{
是的,
类型:“行”
}
},
标题:{
文本:“维度结果”,
x:-80
},
窗格:{
尺寸:“80%”
},
xAxis:{
类别:[],
勾选位置:“on”,
线宽:0
},
亚克斯:{
gridLineInterpolation:“多边形”,
线宽:0,
最低:0
},
工具提示:{
分享:是的,
pointFormat:“{series.name}:${point.y:,.0f}
”
},
图例:{
对齐:“右”,
垂直排列:“顶部”,
y:70,
布局:“垂直”
},
系列:[{
名称:'平均',
数据:[],
}]
};
html:
<highchart id="container" config="configChart" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></highchart>
::更新:::
<highchart id="container" config="configChart" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></highchart>
TL;博士
<highchart id="container" config="configChart" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></highchart>
这是一个现场演示-
<highchart id="container" config="configChart" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></highchart>
首先,您的
系列
不包含数据。对于本例,我使用以下内容对其进行了初始化:
<highchart id="container" config="configChart" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></highchart>
series: [{
name: 'Average',
data: [{
id: "point-1",
x: 1,
y: 49.9
}, {
id: "point-2",
x: 2,
y: 71.5
}, {
...
接下来,您可以通过如下方式扩展chartConfig
对象,在点上设置单击事件:
<highchart id="container" config="configChart" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></highchart>
options: {
plotOptions: {
series: {
cursor: 'pointer',
point: {
events: {
click: function(e) {
var point = {
x: this.x,
y: this.y,
id: this.id
}
$scope.$apply(function() {
$scope.selectedPoint = point;
});
}
}
},
marker: {
lineWidth: 1
}
}
},
...
单击将在$scope.selectedPoint
中存储点元数据。您可以添加$scope.$watch
以在其更改时获取通知:
<highchart id="container" config="configChart" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></highchart>
$scope.$watch('selectedPoint', function(newValue) {
// Here you can fetch more info about this point from the server
console.log(newValue);
});
该视图将根据$scope.selectedPoint
显示所需内容。它可以是二级图,也可以是纯文本元数据
<highchart id="container" config="configChart" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></highchart>
是的,它工作得很好,比如为什么要拦截标题“gouvernance des achats”的点击?好的,我看到了你的最新帖子。请你把我的jsfiddle叉起来,把你的数据填进去,让我试试好吗?
<highchart id="container" config="configChart" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></highchart>