Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/241.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 我应该在一系列高图表中写些什么_Php_Mysql_Highcharts - Fatal编程技术网

Php 我应该在一系列高图表中写些什么

Php 我应该在一系列高图表中写些什么,php,mysql,highcharts,Php,Mysql,Highcharts,我想在系列中使用我的数据库数据 我的表“mob”是这样的: ![我的名为“mob”的表][1] Icost数据不真实 我的代码是这样的: <?php include '../../class/jdf.php'; require_once "../../db.php"; $db = new db(); $query_time = "SELECT DISTINCT iDate FROM mob WHERE 1 "; $datashow = $db->get_arr($query_time

我想在系列中使用我的数据库数据 我的表“mob”是这样的: ![我的名为“mob”的表][1]

Icost数据不真实 我的代码是这样的:

<?php
include '../../class/jdf.php';
require_once "../../db.php";
$db = new db();
$query_time = "SELECT DISTINCT iDate FROM mob WHERE 1 ";
$datashow = $db->get_arr($query_time);

$time = array();
foreach ($datashow as $key => $row) {
    $format = ' Y/m/d ';
    $time[] = jdate($format, $row['iDate']);

}
$query_cost = "SELECT * FROM mob WHERE 1 ";
$data = $db->get_arr($query_cost);                   
   $datamin = $db->get_field('mob','MIN(iCost)','1');
   $datamin = $datamin -100;
   $datamax = $db->get_field('mob','MAX(iCost)','1'); 



<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Highcharts Example</title>

        <script src="../../js/jquery-1.9.1.min.js"></script>
        <script src="../../js/highcharts.js"></script>
        <style type="text/css">
        </style>
        <script type="text/javascript">

           Highcharts.setOptions({

                lang: {
                    numericSymbols: null
                },
            });
            $(function() {
                $('#container').highcharts({

                    chart:
                            {
                        type: 'column'
                    },
                    title: {
                        text: 'my chart '
                    },
                    subtitle: {
                        text: 'mob'
                    },
                    xAxis: {
                        categories: [

                            <?php
                            foreach ($time as $value) {
                                echo "'" . $value . "',";
                            }
                            ?>

                        ]
                    },
                    yAxis: {
                        min :<?php echo $datamin ?>,
                        max :<?php echo $datamax ?>,
                        title: {
                            text: 'cost'
                        }
                    },
                    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:.1f} mm</b></td></tr>',
                        footerFormat: '</table>',
                        shared: true,
                        useHTML: true
                    },
                    plotOptions: {
                        column: {
                            pointPadding: 0.2,
                            borderWidth: 0
                        }
                    },
                    series: []
                });
            });
        </script>
    </head>
    <body>

        <script src="../../js/modules/exporting.js"></script>

        <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>

    </body>
</html>

在php中,准备正确的数组(根据avascript结构)并使用json_encode()。在javasctrip调用$.getJSON()中,获取数据并在highcharts中使用


有关预处理数据的更多信息,

请原谅问题格式不正确。这是我第一次来这里