Highcharts 如何仅对“向下展开”选项使用绘制线?
我使用了列和向下钻取的highchart 它的深入研究是 我在深入分析中获得了正确的输出,但我不希望在第一幅图像中显示绘图线。我如何解决这个问题Highcharts 如何仅对“向下展开”选项使用绘制线?,highcharts,Highcharts,我使用了列和向下钻取的highchart 它的深入研究是 我在深入分析中获得了正确的输出,但我不希望在第一幅图像中显示绘图线。我如何解决这个问题 $(document).ready(function () { }); angular.module('myModule', []).service("AttendanceService", function ($http) { this.getdata = function () { return $ht
$(document).ready(function () { });
angular.module('myModule', []).service("AttendanceService", function ($http) {
this.getdata = function () {
return $http({
method: "post",
url: "GetAttendanceReport",
params: [{ EmpID: $("#nameofEmp").val(), YearID: $("#YearIn").val() }],
dataType: "json"
});
};
}).controller('myController', function ($scope,AttendanceService) {
GetAlldata();
function GetAlldata() {
var getAttendanceData = AttendanceService.getdata();
getAttendanceData.then(function (Attendances) {
Highcharts.chart('container', {
chart: {
type: 'column'
},
title: {
text: 'Attendance Report' + ' ' + $("#YearIn option:selected").text()
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: 'Total Attendance Recorded'
},
plotLines: [{
value: 8,
color: '#ff0000',
width: 2,
zIndex: 4,
label: { text: 'goal' },
}],
},
legend: {
enabled: false
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
format: '{point.y:.2f}'
}
}
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}mins</b> of total<br/>'
},
series: [{
name: 'Attendance',
colorByPoint: true,
data: [{
name: 'Jan',
y: Attendances.data.YearlyReport[0],
drilldown: 'Jan'
}, {
name: 'Feb',
y: Attendances.data.YearlyReport[1],
drilldown: 'Feb'
}, {
name: 'March',
y: Attendances.data.YearlyReport[2],
drilldown: 'March'
}, {
name: 'April',
y: Attendances.data.YearlyReport[3],
drilldown: 'April'
}, {
name: 'May',
y: Attendances.data.YearlyReport[4],
drilldown: 'May'
}, {
name: 'June',
y: Attendances.data.YearlyReport[5],
drilldown: 'June'
}, {
name: 'July',
y: Attendances.data.YearlyReport[6],
drilldown: 'July'
}, {
name: 'Aug',
y: Attendances.data.YearlyReport[7],
drilldown: 'Aug'
}, {
name: 'Sep',
y: Attendances.data.YearlyReport[8],
drilldown: 'Sep'
}, {
name: 'Oct',
y: Attendances.data.YearlyReport[9],
drilldown: 'Oct'
}, {
name: 'Nov',
y: Attendances.data.YearlyReport[10],
drilldown: 'Nov'
}, {
name: 'Dec',
y: Attendances.data.YearlyReport[11],
drilldown: 'Dec'
}]
}],
drilldown: {
series:
[{
name: 'Jan',
id: 'Jan',
data: [
[
'1',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 1])
],
[
'2',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 2])
],
[
'3',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 3])
],
[
'4',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 4])
],
[
'5',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 5])
],
[
'6',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 6])
],
[
'7',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 7])
],
[
'8',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 8])
],
[
'9',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 9])
],
[
'10',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 10])
],
[
'11',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 11])
],
[
'12',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 12])
],
[
'13',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 13])
],
[
'14',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 14])
],
[
'15',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 15])
],
[
'16',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 16])
],
[
'17',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 17])
],
[
'18',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 18])
],
[
'19',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 19])
],
[
'20',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 20])
],
[
'21',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 21])
],
[
'22',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 22])
],
[
'23',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 23])
],
[
'24',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 24])
],
[
'25',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 25])
],
[
'26',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 26])
],
[
'27',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 27])
],
[
'28',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 28])
],
[
'29',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 29])
],
[
'30',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 30])
],
[
'31',
parseFloat(Attendances.data.MonthlyReport[1 * 33 + 31])
]
]},and so on]
}
});
}, function () {
alert('Error in getting records');
});
} $("#btnLoad").click(function (event) {
GetAlldata();
});
$("#btnBack").click(function (event) {
window.location.href = "homepage";
});
});
$(document).ready(函数(){});
angular.module('myModule',[]).service('AttendanceService',function($http){
this.getdata=函数(){
返回$http({
方法:“张贴”,
url:“GetAttendancePort”,
参数:[{EmpID:$(“#nameofEmp”).val(),YearID:$(“#YearIn”).val()},
数据类型:“json”
});
};
}).controller('myController',函数($scope,AttendanceService){
GetAlldata();
函数GetAlldata(){
var getAttendanceData=AttendanceService.getdata();
getAttendanceData.then(函数(出席){
Highcharts.chart('容器'{
图表:{
类型:“列”
},
标题:{
text:“考勤报告”+“”+$(“#YearIn选项:选中”)。text()
},
xAxis:{
类型:“类别”
},
亚克斯:{
标题:{
文本:“记录的总出勤率”
},
绘图线:[{
数值:8,
颜色:“#ff0000”,
宽度:2,
zIndex:4,
标签:{text:'goal'},
}],
},
图例:{
已启用:false
},
打印选项:{
系列:{
边框宽度:0,
数据标签:{
启用:对,
格式:“{point.y:.2f}”
}
}
},
工具提示:{
headerFormat:“{series.name}
”,
pointFormat:“{point.name}:{point.y:.2f}分钟,总计
”
},
系列:[{
姓名:'出席人数',
colorByPoint:对,
数据:[{
姓名:“Jan”,
y:出席率。数据。年报[0],
深入研究:“简”
}, {
姓名:'Feb',
y:出席人数。数据。年报[1],
深入研究:“二月”
}, {
姓名:"三月",,
y:出席人数。数据。年报[2],
深入研究:“三月”
}, {
姓名:‘四月’,
y:出席人数。数据。年报[3],
深入研究:“四月”
}, {
姓名:“May”,
y:出席人数。数据。年报[4],
深入研究:“五月”
}, {
姓名:‘六月’,
y:出席人数。数据。年报[5],
深入研究:“六月”
}, {
姓名:‘七月’,
y:出席人数。数据。年报[6],
深入研究:“七月”
}, {
姓名:'Aug',
y:出席人数。数据。年报[7],
深入研究:“八月”
}, {
名称:“Sep”,
y:出席人数。数据。年报[8],
深入研究:“Sep”
}, {
名称:'十月',
y:出席人数。数据。年报[9],
深入研究:“十月”
}, {
名称:'Nov',
y:出席人数。数据。年报[10],
深入研究:“11月”
}, {
名称:'Dec',
y:出席人数。数据。年报[11],
深入研究:“十二月”
}]
}],
向下展开:{
系列:
[{
姓名:“Jan”,
id:'一月',
数据:[
[
'1',
parseFloat(出席率.数据.月度报告[1*33+1])
],
[
'2',
parseFloat(出席率.数据.月度报告[1*33+2])
],
[
'3',
parseFloat(出席率.数据.月度报告[1*33+3])
],
[
'4',
parseFloat(出席率.数据.月度报告[1*33+4])
],
[
'5',
parseFloat(出席率。数据。月度报告[1*33+5])
],
[
$(function() {
$('#container').highcharts({
chart: {
events: {
drilldown: function() {
this.xAxis[0].removePlotLine('p1');
},
drillup: function() {
this.xAxis[0].addPlotLine({
id: 'p1',
value: 8,
color: '#ff0000',
width: 2,
zIndex: 4,
label: {
text: 'goal'
}
});
}
}
},
series: [{
type: 'column',
data: [{
y: 42,
drilldown: 's2'
}]
}],
drilldown: {
series: [{
id: 's2',
data: [1, 2, 3]
}]
},
yAxis: {
plotLines: [{
id: 'p1',
value: 8,
color: '#ff0000',
width: 2,
zIndex: 4,
label: {
text: 'goal'
}
}]
}
});
});