如何在高图中输入null然后在折线图中忽略它?

我正在使用highcharts创建一个折线图,每当输入为null时,折线图就会分成散点图。 我希望它只是忽略该值并连接到图中的下一个点。 我想我使用了正确的代码,但图表仍然不会让步。 当我将鼠标hover在值上时,工具提示甚至会显示为null(我是否用CSV中的单词写入null或者只是离开;;)…

$("select").change(function() { $("select option:selected").each(function() { var variable = $(this).val(); var graphtitle; switch (variable) { case "CSV/Sheet1.csv": graphtitle = "Academic-Corporate Collaboration"; break; case "CSV/Sheet2.csv": graphtitle = "Academic-Corporate Collaboration Impact"; break; case "CSV/Sheet3.csv": graphtitle = "Citation Count"; break; case "CSV/Sheet4.csv": graphtitle = "Citation Count, self-citations excluded"; break; case "CSV/Sheet5.csv": graphtitle = "Citations per Publication"; break; case "CSV/Sheet6.csv": graphtitle = "Citations per publication, self-citations excluded"; break; case "CSV/Sheet7.csv": graphtitle = "Cited publications (%)"; break; case "CSV/Sheet8.csv": graphtitle = "Cited publications (%), self-citations excluded"; break; case "CSV/Sheet9.csv": graphtitle = "Field-Weighted Citation Impact"; break; case "CSV/Sheet10.csv": graphtitle = "Output in top 10 percentiles (%)"; break; case "CSV/Sheet11.csv": graphtitle = "Output in top 10 percentiles (%), self-citations excluded"; break; case "CSV/Sheet12.csv": graphtitle = "Publications in top 10 journal percentiles (%, SJR)"; break; case "CSV/Sheet13.csv": graphtitle = "Scholarly Output"; break; } $.get(variable, function(csv) { $('.graphcontainer').highcharts({ chart: { type: 'line' }, data: { csv: csv, itemDelimiter: ';' }, title: { text: graphtitle }, plotOptions: { series: { connectNulls: true } }, yAxis: { title: { text: '' } }, legend: { layout: 'vertical' }, credits: { enabled: false }, tooltip: { formatter: function() { var s = []; $.each(this.points, function(i, point) { s.push('' + point.series.name + ' : ' + point.y + '
'); }); return s.join(''); }, shared: true } }); }); }); }) .change();
 .graphcontainer { width: 80%; height: 600px; margin: auto; border: 1px solid black; } #selectcontainer { width: 80%; margin: auto; border: 1px solid black; } #CSVinput { width: 60%; font-family: verdana; margin-left: 20%; } 
    Grafi IJS         
Academic-Corporate Collaboration Academic-Corporate Collaboration Impact Citation Count Citation Count, self-citations excluded Citations per Publication Citations per publication, self-citations excluded Cited publications (%) Cited publications (%), self-citations excluded Field-Weighted Citation Impact Output in top 10 percentiles (%) Output in top 10 percentiles (%), self-citations excluded Publications in top 10 journal percentiles (%, SJR) Scholarly Output

这是我的CSV输入:

类别; CNRS; DACH – 奥地利,德国和瑞士;欧洲; J. 斯特凡研究所;马克斯普朗克学会;卢布尔雅那国立生物研究所;卢布尔雅那国立化学研究所;斯洛文尼亚科学与艺术科学研究中心;斯洛文尼亚;美国;斯图加特大学;卢布尔雅那大学;马里博尔大学;新星大学Gorica总体; 1.9; 3.1; 1.9; 1.4; 2.9; 0.8; 2.3; 0.4; 1.2; 3; 4.7; 1.2; 0.4; 4.8 1996; 1.7; 2.7; 1.8; 0.5; 3.8; 0; 2.5; 0; 1.3; 3.1; 5.2; 1.7; 0 ;; 1997; 1.5; 2.8; 1.8; 1.4; 4; 0; 1.7; 0; 0.6; 3.2; 6.5; 0.7; 0 ;; 1998; 1.8; 2.9; 1.9; 1.6; 4; 0; 0; 0; 0.9; 3.3; 5.5; 1; 0.6 ;; 1999; 1.8; 2.8; 1.8; 0.3; 4; 0; 2.7; 0; 0.8; 3.1; 4.8; 0.9; 0; 0 2000; 1.7; 2.7; 1.7; 1.2; 2.9; 0; 0; 0; 0.8; 2.9 ; 4.6; 0.8; 1.2; 0 2001; 1.6; 2.6; 1.6; 1.6; 3.2; 0; 0 ;; 0.7; 2.6; 5; 1; 0; 4.2 2002; 1.5; 2.6; 1.6; 0.7; 2.8; 0; 0; 0; 0.8; 2.5; 4.3; 0.7; 0.4; 8 2003; 1.4; 3.3; 2.1; 1.7; 3.1; 4.2; 1.4; 0; 1.1; 3.2; 7; 1.3; 0.2; 2.5 2004; 1.4; 3.4; 2.2; 1.6; 3; 3; 2.6; 0; 1.3; 3.3; 4.8; 1.8; 0.3; 1.9 2005; 2.1; 3.4; 2.2; 1.5; 2.9; 2.9; 1.9; 0; 1.3; 3.3; 5.8; 1.5; 1 ; 1.2 2006; 1.7; 3.2; 2.1; 1.8; 2.9; 0; 3.7; 0; 1.5; 3.2; 5.5; 2; 0.2; 2 2007; 2.3; 3.4; 2.1; 0.6; 2.8; 0; 3.8; 0; 0.9 ; 3.3; 5.6; 1; 0.4; 0 2008; 1.7; 3.3; 2.1; 0.5; 2.6; 0; 3.1; 0; 1.3; 3.2; 4.8; 1.4; 0.3; 6.1 2009; 1.9; 3.3; 2; 3.1; 2.4 ; 1.2; 1.1; 0; 1.9; 3.1; 4.2; 1.8; 0.2; 4.9 2010; 2; 3.2; 1.9; 1.6; 2.3; 1.8; 3.2; 0; 1.2; 2.9; 4.2; 1.2; 0.6; 4.2 2011; 2.1 ; 3.2; 1.9; 1.8; 2.4; 0; 2.4; 3.4; 1.1; 2.9; 3.5; 1.1; 0.3; 5.3 2012; 2.3; 3.2; 1.9; 1.4; 2.3; 2; 3.6; 0; 1.1; 2.8; 3.4; 1; 0.1; 4.3 2013; 2.2; 3.2; 1.8; 1.2; 2.5; 0; 3.4; 0; 1.4; 2.7; 3.8; 1.1; 0.4; 12.5 2014; 2.5; 3.1; 1.8; 1.7; 2.6; 0; 2.2; 0; 1.3; 2.7; 3.6; 1.3; 0.2; 7.6

编辑:更新的代码和问题,添加CSV,截图供参考

scrrenshot的工具提示和图形

您可以使用connectNulls

  plotOptions:{ series:{ connectNulls:true } }, 

http://jsfiddle.net/7nfwe8mg/