日期:2014-05-17 浏览次数:20695 次
var conditionId = $("#condition").val();//统计条件 var conditionStr = $("#condition option[value='"+conditionId+"']").html(); var targetId = $("#target").val(); var targetStr = $("#target option[value='"+targetId+"']").html(); var danwei = targetStr.substring(targetStr.indexOf('()')+1,targetStr.indexOf(')')); // 折线图 var options3 = { chart: { renderTo: 'container3', type: 'line' }, title: { text: targetStr }, subtitle: { text: '单位(' + danwei + ')' }, xAxis: { categories: [] }, yAxis: { title: { text: targetStr + '分布' } }, tooltip: { enabled: true, formatter: function() { return '<b>'+ this.x +':</b> '+ this.y + ' ' + danwei + '<br/>'; } }, plotOptions: { line: { dataLabels: { enabled: true }, enableMouseTracking: true } }, series: [{ name: targetStr, data: [] }] }; // 折线图 options3.subtitle.text = '(单位:' + danwei + ',总数:' + sumNum + ' ' + danwei + ')'; options3.xAxis.categories = cateArr; options3.series[0].data = dataArr; new Highcharts.Chart(options3);