我正在尝试折线图,即http://www.highcharts.com/demo/line-basic。需要在每个系列的最后一点之后显示系列名称。尝试使用线和系列的不同绘图选项。然而做不到。
有人可以帮忙吗?
function GChart() {
jQuery(document).ready(function() {
var Options = {
chart: {
renderTo: 'container',
defaultSeriesType: 'line',
marginRight: 100,
marginBottom: 40
},
title: {
x: -20
},
subtitle: {
},
xAxis: {
categories: []
},
yAxis: {
},
tooltip: {
formatter: function() {
return '<b>' + this.series.name + '</b><br/>' +
this.x + ': ' + this.y + 'Kg.';
}
},
legend: {
enabled: false
},
plotOptions: {
series: {
marker: {
enabled: false
}
}
},
series: []
};
$.get('Newchart.html', function(data) {
var fulldata = document.getElementById("MyHiddenField").value;
var MyChartTitle = document.getElementById("MyChartTitle").value;
var MyChartSubTitle = document.getElementById("MyChartSubTitle").value;
var MyChartXTitle = document.getElementById("MyChartXTitle").value;
var MyChartYTitle = document.getElementById("MyChartYTitle").value;
var lines = fulldata.split('$');
var series = [];
var temp;
$.each(lines, function(lineno, line) {
temp = line.split('#');
series.data = JSON.parse("[" + temp[1] + "]");
series.name = temp[0];
if (lineno == 0) {
series.color = "#FF0000";
}
else {
series.color = "#058DC7";
}
series.push({ name: series.name, data: series.data, color: series.color });
});
Options.series = series;
Options.title = { text: MyChartTitle, align: 'left', x: 90, y: 74, floating: true };
Options.subtitle = { text: MyChartSubTitle, align: 'left', x: 120, y: 87, floating: true };
Options.xAxis.title = { text: MyChartXTitle };
Options.yAxis.title = { text: MyChartYTitle };
Options.yAxis.tickInterval = 5;
Options.xAxis.tickInterval = 1;
Options.xAxis.min = 5;
Options.yAxis.min = 5;
var chart = new Highcharts.Chart(Options);
});
});
}