json_encode
から派生したjavascriptの配列がありjqplot
ます。jqplot で配列をプロットする方法。
次のコードは値を取得し、JavaScript 配列を作成する 2 つのテキスト ボックスに配置します。newArray2JS
inx-axis
とnewArrayJS
inをプロットする必要がありますy-axis
<script type='text/javascript'>
function parseMe(){
var json=document.getElementById('json_text').value;
var obj=eval('('+json+')');
document.createElement('u1');
alert(obj);
for(val in obj){
alert(obj[val]);
//alert(obj[val]);
//}
}}
</script>
</head>
<body>
<form>
<input type='text' id='json_text1' value='<?php echo $newArrayJS; ?>' />
<input type='text' id='json_text2' value='<?php echo $newArray2JS; ?>' />
<input type='button' value='parse' onclick='parseMe();' />
</form>
<div id = 'chart1'></div>
私はjqplot
jsonが初めてです。
これどうやってするの。