问题描述
UI JS MVC c#上未显示高位图
下面是我的代码,我正在动态获取此[9.0,10.99,15.5,19.7,7.0,13.2]数据。我已经尝试了不同的方法,但是没有用。
我第一次在高图表上工作。有人可以帮我吗
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<div id="container" style="min-width:310px; height:400px;margin:0 auto"></div>
<script type="text/javascript">
$(document).ready(function () {
debugger;
var Params = [];
var DSet = [];
var PprofileId = 1;
var PparamName = 'Motor RPM';
$.ajax({
type: 'POST',url: '/ThirdPartyDriveData/GetDriveDataByIdAndName',data: { profileId: PprofileId,paramName: PparamName },success: function (data) {
debugger;
$.each(data.data,function (index,item) {
debugger;
if (item.Dataset != '' && item.Dataset >= 0) {
DSet.push(item.Dataset);
Params.push(item.ParameterName);
}
});
//alert(result);
CreateChart(DSet,Params);
//alert(response);
},Error: function () { }
});
});
function CreateChart(DSet) {
debugger;
Highcharts.chart('container',{
chart: {
type: 'line'
},title: {
text: 'Monthly Average Temperature'
},subtitle: {
text: 'Source: Worldclimate.com'
},xAxis: {
categories: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
},yAxis: {
title: {
text: 'Temperature (°C)'
}
},plotOptions: {
line: {
dataLabels: {
enabled: true
},enableMouseTracking: false
}
},series: [{
name: 'Parameter',data: DSet
}]
});
}
</script>
有人可以帮我吗
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)