Cakephp代码使用查询选择数据并在视图文件中显示
来自查询的数据如下图所示 [在此处输入图像描述][1] 请告诉我如何在我的视图中回显数据 我尝试了下面的代码来回音,但没有工作 我需要在下面的高图中回显数据 请帮帮我Cakephp代码使用查询选择数据并在视图文件中显示,cakephp,Cakephp,来自查询的数据如下图所示 [在此处输入图像描述][1] 请告诉我如何在我的视图中回显数据 我尝试了下面的代码来回音,但没有工作 我需要在下面的高图中回显数据 请帮帮我 <script type="text/javascript"> $(function () { $('#container').highcharts({ chart: { type: 'column' }, title: {
<script type="text/javascript">
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: ''
},
subtitle: {
text: ''
},
xAxis: {
categories: [
'1000',
'2000',
'3000',
'4000',
'5000',
'6000',
'7000',
'8000',
'9000',
'10000',
'11000',
'12000'
],
crosshair: true
},
yAxis: {
min:0 ,
title: {
text: null
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y} mm</b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
legend: {
layout: 'vertical',
align: 'center',
verticalAlign: 'top',
floating: true,
borderWidth: 1,
width: 100,
height: 100
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
format: '{point.y}'
}
}
},
labels:
{
enabled: false
},
series: [{
name: 'Tokyo',
data: [<?php echo $dest_pcode; ?>, 121, 111, 154, 143, 143, 165, 148, 216, 194, 95,142]
},{
name: 'Berlin',
data: [<?php echo $origin_pcode; ?>, 33, 176, 39, 52, 75, 133, 47, 177, 46, 51,110]
}]
});
});
</script>
使用$.parseJSON解析数组并将其放入jquery变量
var content=$.parseJSON('<?php echo $comparequotes;?>');
然后根据需要在数据中输入该变量
var content=$.parseJSON('<?php echo $comparequotes;?>');