Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/287.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/82.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 从SQL创建图表_Php_Sql_Charts - Fatal编程技术网

Php 从SQL创建图表

Php 从SQL创建图表,php,sql,charts,Php,Sql,Charts,我正试图在SQL的帮助下创建下面的图表。但我只得到图表上的最后一行。我应该在哪里检查 目标图表: $ChartRef = 'my_chart'; // Title of the shape that embeds the chart $SeriesNameOrNum = 1; $NewValues = array( array('Cat. A','Cat. B','Cat. C','Cat. D'), array(12.7, 1.5, 3.2, 4.8)); $NewLegend

我正试图在SQL的帮助下创建下面的图表。但我只得到图表上的最后一行。我应该在哪里检查

目标图表:

 $ChartRef = 'my_chart'; // Title of the shape that embeds the chart
 $SeriesNameOrNum = 1;
 $NewValues = array( array('Cat. A','Cat. B','Cat. C','Cat. D'), array(12.7, 1.5,   3.2,   4.8));
 $NewLegend = "Polomp";
 $TBS->PlugIn(OPENTBS_CHART, $ChartRef, $SeriesNameOrNum, $NewValues, $NewLegend);
 // Merge a chart
 $ChartRef = 'my_chart'; // Title of the shape that embeds the chart
 $SeriesNameOrNum = 2;
 $NewValues = array( array('Cat. A','Cat. B','Cat. C','Cat. D'), array(12.7, 1.5, 3.2, 4.8) );
$NewLegend = "Polomp2";
 $TBS->PlugIn(OPENTBS_CHART, $ChartRef, $SeriesNameOrNum, $NewValues, $NewLegend);
// Merge a chart
$ChartRef = 'my_chart'; // Title of the shape that embeds the chart
$SeriesNameOrNum = 3;
$NewValues = array( array('Cat. A','Cat. B','Cat. C','Cat. D'), array(0.7, 2.5, 1.2, 3.8) );
$NewLegend = "Polomp3";
$TBS->PlugIn(OPENTBS_CHART, $ChartRef, $SeriesNameOrNum, $NewValues, $NewLegend);
这里

我的代码:

$sql = "SELECT * FROM  gs_rekurse Order By Id DESC LIMIT 3"; 
$result = mysql_query($sql);
$cats = array();
$values = array();
$i = 1;
while($row = mysql_fetch_array($result, MYSQLI_ASSOC)){
$ChartRef = 'my_chart'; // Title of the shape that embeds the chart
$SeriesNameOrNum =$i;
$NewLegend ="Polpmp$i";
$cats[] = $row['Datum'];
$values[] = $row['Unterstellungen'];
$i++;
} 
$NewValues = array($cats, $values);
$TBS->PlugIn(OPENTBS_CHART, $ChartRef, $SeriesNameOrNum, $NewValues, $NewLegend);

谢谢

$TBS包含什么?在您的代码中,您只需调用
$TBS->PlugIn
一次。在“目标图”中,你称它三次。我认为您应该将
$TBS->PlugIn
调用移动到
中,同时