im thingspeak apiを使用してデータを取得しています。私は融合図にデータを表示したい。グラフに動的データを表示する方法は?このコードは他のサードパーティのapisでは動作しますが、このapiでは動作しません。あなたはdata.success
かどうかを確認する必要はありませんグラフのデータを表示するためにAPIからデータを取得することができません
サンプルデータ 172.70
API
https://api.thingspeak.com/channels/23037xxx/fields/field1/last?api_key=EG628M4J9SP76xxx
<script>
FusionCharts.ready(function() {
LoadChart();
});
function LoadChart() {
$.ajax({
url: 'https://api.thingspeak.com/channels/230xxx/fields/field1/last?api_key=EG628M4J9SP76xxx', // local address
type: 'GET',
crossDomain: true,
success: function (data) {
if (data.success) {
var chlorine = data;
var phfusioncharts = new FusionCharts({
type: 'angulargauge',
renderAt: 'ph-container',
width: '450',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Chlorine ",
"lowerLimit": "0",
"upperLimit": "14",
"showValue": "1",
"valueBelowPivot": "1",
"theme": "fint"
},
"colorRange": {
"color": [{
"minValue": "0",
"maxValue": "5",
"code": "#6baa01"
}, {
"minValue": "5",
"maxValue": "10",
"code": "#f8bd19"
}, {
"minValue": "10",
"maxValue": "14",
"code": "#e44a00"
}]
},
"dials": {
"dial": [{
"value": chlorine
}]
}
}
});
phfusioncharts.render();
}
}
});
}
</script>
</head>
<body>
<table class="">
<tr>
<td><div id="ph-container" style="float:left;"></div></td>
</tr>
</table>
あなたが具体的でした "_thisコードがworking_ではありませんか"?どのようなエラーが出ますか?質問を編集し、さらに情報を追加してください。 – Lucky
imはconsole.itsから何のエラーも得ておらず、グラフを表示していません。 – Swapna
jsfiddle.netでコードを再作成し、ここにリンクを投稿してください。 – Lucky