http://www.maani.us/charts/index.php...art_Attributes
Hallo Leutz wollte mal fragen ob ihr mit helfen könnt. Ich habe das script zum link eigentlich komplett richtig eingebunden . Wenn ich das normale array verwende sprich:
$chart [ 'chart_data' ][ 0 ][ 0 ] = "";
$chart [ 'chart_data' ][ 0 ][ 1 ] = "2001";
$chart [ 'chart_data' ][ 0 ][ 2 ] = "2002";
$chart [ 'chart_data' ][ 0 ][ 3 ] = "2003";
$chart [ 'chart_data' ][ 0 ][ 4 ] = "2004";
$chart [ 'chart_data' ][ 1 ][ 0 ] = "Region A";
$chart [ 'chart_data' ][ 1 ][ 1 ] = 5;
$chart [ 'chart_data' ][ 1 ][ 2 ] = 10;
$chart [ 'chart_data' ][ 1 ][ 3 ] = 30;
$chart [ 'chart_data' ][ 1 ][ 4 ] = 63;
$chart [ 'chart_data' ][ 2 ][ 0 ] = "Region B";
$chart [ 'chart_data' ][ 2 ][ 1 ] = 100;
$chart [ 'chart_data' ][ 2 ][ 2 ] = 20;
$chart [ 'chart_data' ][ 2 ][ 3 ] = 65;
$chart [ 'chart_data' ][ 2 ][ 4 ] = 55;
$chart [ 'chart_data' ][ 3 ][ 0 ] = "Region C";
$chart [ 'chart_data' ][ 3 ][ 1 ] = 56;
$chart [ 'chart_data' ][ 3 ][ 2 ] = 21;
$chart [ 'chart_data' ][ 3 ][ 3 ] = 5;
$chart [ 'chart_data' ][ 3 ][ 4 ] = 90;
zeigt er die daten wunderbar an . Wenn ich mein array verwende welches ich per abrage mit mysql selbst geschrieben habe zeigt er nix an
Vielleicht hat ja einer von euch nen tip also die Datenbank habe ich in diesem Fall auch angesprochen
Folgende index.php wird per include von meiner hauptseite in eine tabelle projiziert.
index.php------------------->>>>
<table cellspacing="1" cellpadding="2" border="0" bgcolor="<?php echo $_SESSION['$colorx_9'];?>" WIDTH="<?php echo $_SESSION['cms_width_correction'];?>">
<tr>
<td bgcolor="<?php echo $_SESSION['$colorx_7'];?>" class="small" width="<?php echo $_SESSION['cms_width_correction_130'];?>">
<table cellpadding="2" cellspacing="5" border="0">
<tr>
<td valign="top" class="news">
<table cellspacing="0" cellpadding="1" border="0" bgcolor="<?php echo $_SESSION['$colorx_6'];?>"><tr><td>
<table cellspacing="0" cellpadding="1" border="0" bgcolor="<?php echo $_SESSION['$colorx_7'];?>"><tr><td>
<table cellspacing="0" cellpadding="2" border="0" bgcolor="<?php echo $_SESSION['$colorx_8'];?>"><tr><td>
<table cellspacing="0" cellpadding="1" border="0" bgcolor="<?php echo $_SESSION['$colorx_6'];?>"><tr><td>
<?php include(BASEDIR . "menu/auswahl_statistik/screen.php"); ?>
</td></tr></table>
</td></tr></table>
</td></tr></table>
</td></tr></table>
<?php include(BASEDIR . "menu/auswahl_statistik/screen_footer.php"); ?>
</td>
<td align="center" valign="top">
<?php include(BASEDIR . "menu/auswahl_statistik/ueberschrift_top.php");
?>
<br> <br>
<?php
//include charts.php to access the InsertChart function
include "charts.php";
$_SESSION['transfer_id'] = $_POST[transfer_id];
echo InsertChart ( "charts.swf", "charts_library", "menu/auswahl_statistik/sample.php?localy=$_SESSION[chooser]&userid=$_SESSION[transfer_id] ", 400, 250 );
?>
<?php
include(BASEDIR . "menu/auswahl_statistik/ueberschrift_footer.php"); //HIER ZWISCHEN TEXT ENDE ?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" class="small" bgcolor="<?php echo $_SESSION['$colorx_d'];?>"><?php echo $_SESSION['$shell'];?></td>
</tr>
</table>
sample.php---------------------------->>>>>>>>>>>
<?php
include 'charts.php';
$server = "localhost";
$_SESSION['transfer_id'] = $_POST[userid];
$_SESSION['chooser'] = $_REQUEST[localy];
if($_SESSION['chooser']== 0) {
$user = "SECRET WEBSITE DATA"; // MySQL-Nutzer
$pass = "SECRET WEBSITE DATA"; // MySQL-Kennwort
$dbase = "SECRET WEBSITE DATA"; // Datenbank
}
if($_SESSION['chooser']== 1) {
$user = "SECRET LOCAL DATA"; // MySQL-Nutzer
$pass = "SECRET LOCAL DATA"; // MySQL-Kennwort
$dbase = "SECRET LOCAL DATA"; // Datenbank
}
$conn = @mysql_connect($server, $user, $pass);
if($conn) {
mysql_select_db($dbase, $conn);
} else {
die("<b>Verbindung zum MySQL-Server konnte nicht hergestellt werden </b></body></html>");
}
$query = "SELECT * FROM rangliste where fk_user= $_SESSION[transfer_id] ";
$resultID = mysql_query($query) ;
$rows= mysql_num_rows($resultID);
$chart[ 'axis_category' ] = array ( 'size'=>14, 'color'=>"000000", 'alpha'=>0, 'font'=>"arial", 'bold'=>true, 'skip'=>0 ,'orientation'=>"horizontal" );
$chart[ 'axis_ticks' ] = array ( 'value_ticks'=>true, 'category_ticks'=>true, 'major_thickness'=>2, 'minor_thickness'=>1, 'minor_count'=>1, 'major_color'=>"000000", 'minor_color'=>"222222" ,'position'=>"outside" );
$chart[ 'axis_value' ] = array ( 'min'=>0, 'max'=>120, 'font'=>"arial", 'bold'=>true, 'size'=>10, 'color'=>"ffffff", 'alpha'=>50, 'steps'=>6, 'prefix'=>"", 'suffix'=>"", 'decimals'=>0, 'separator'=>"", 'show_min'=>true );
$chart[ 'chart_border' ] = array ( 'color'=>"000000", 'top_thickness'=>2, 'bottom_thickness'=>2, 'left_thickness'=>2, 'right_thickness'=>2 );
$chart [ 'chart_data' ][ 0 ][ 0 ] = "";
for($x =1 ; $x < mysql_num_rows($resultID) ; $x++){
$dsatz = mysql_fetch_assoc($resultID);
$chart [ 'chart_data' ][ 0 ][ $x] = $dsatz["monat"];
}
$chart [ 'chart_data' ][ 1 ][ 0 ] = "Region A";
for($y = 1 ; $y < mysql_num_rows($resultID2) ; $y++){
$dsatz222 = mysql_fetch_assoc($resultID2);
$chart [ 'chart_data' ][ 1 ][ $y ] = $dsatz222["punkte"];
}
$chart[ 'chart_grid_h' ] = array ( 'alpha'=>10, 'color'=>"000000", 'thickness'=>1, 'type'=>"solid" );
$chart[ 'chart_grid_v' ] = array ( 'alpha'=>10, 'color'=>"000000", 'thickness'=>1, 'type'=>"solid" );
$chart[ 'chart_pref' ] = array ( 'line_thickness'=>2, 'point_shape'=>"none", 'fill_shape'=>false );
$chart[ 'chart_rect' ] = array ( 'x'=>40, 'y'=>25, 'width'=>335, 'height'=>200, 'positive_color'=>"000000", 'positive_alpha'=>30, 'negative_color'=>"ff0000", 'negative_alpha'=>10 );
$chart[ 'chart_type' ] = "Line";
$chart[ 'chart_value' ] = array ( 'prefix'=>"", 'suffix'=>"", 'decimals'=>0, 'separator'=>"", 'position'=>"cursor", 'hide_zero'=>true, 'as_percentage'=>false, 'font'=>"arial", 'bold'=>true, 'size'=>12, 'color'=>"ffffff", 'alpha'=>75 );
$chart[ 'draw' ] = array ( array ( 'type'=>"text", 'color'=>"ffffff", 'alpha'=>15, 'font'=>"arial", 'rotation'=>-90, 'bold'=>true, 'size'=>50, 'x'=>-10, 'y'=>348, 'width'=>300, 'height'=>150, 'text'=>"hertz", 'h_align'=>"center", 'v_align'=>"top" ),
array ( 'type'=>"text", 'color'=>"000000", 'alpha'=>15, 'font'=>"arial", 'rotation'=>0, 'bold'=>true, 'size'=>60, 'x'=>0, 'y'=>0, 'width'=>320, 'height'=>300, 'text'=>"output", 'h_align'=>"left", 'v_align'=>"bottom" ) );
$chart[ 'legend_rect' ] = array ( 'x'=>-100, 'y'=>-100, 'width'=>10, 'height'=>10, 'margin'=>10 );
$chart[ 'series_color' ] = array ( "77bb11", "cc5511" );
SendChartData ( $chart );
?>
charts.php--------------------------------->>>>>>>>>>>>>
habe ich die orginale aus dem beispiel der website genommen
Bin schon echt am verzweifeln, da er die Tabelle ja anzeigt sobald man dem array die daten manuell zuweist.
Der Fehler müssste somit in der for schleife liegen , da die query ja auch ohnne for schleife mit manuellen daten läuft. Kann der Fehler my mysql_fetch_assoc entstehen oder ist es die for schelife ?
Danke
Hallo Leutz wollte mal fragen ob ihr mit helfen könnt. Ich habe das script zum link eigentlich komplett richtig eingebunden . Wenn ich das normale array verwende sprich:
$chart [ 'chart_data' ][ 0 ][ 0 ] = "";
$chart [ 'chart_data' ][ 0 ][ 1 ] = "2001";
$chart [ 'chart_data' ][ 0 ][ 2 ] = "2002";
$chart [ 'chart_data' ][ 0 ][ 3 ] = "2003";
$chart [ 'chart_data' ][ 0 ][ 4 ] = "2004";
$chart [ 'chart_data' ][ 1 ][ 0 ] = "Region A";
$chart [ 'chart_data' ][ 1 ][ 1 ] = 5;
$chart [ 'chart_data' ][ 1 ][ 2 ] = 10;
$chart [ 'chart_data' ][ 1 ][ 3 ] = 30;
$chart [ 'chart_data' ][ 1 ][ 4 ] = 63;
$chart [ 'chart_data' ][ 2 ][ 0 ] = "Region B";
$chart [ 'chart_data' ][ 2 ][ 1 ] = 100;
$chart [ 'chart_data' ][ 2 ][ 2 ] = 20;
$chart [ 'chart_data' ][ 2 ][ 3 ] = 65;
$chart [ 'chart_data' ][ 2 ][ 4 ] = 55;
$chart [ 'chart_data' ][ 3 ][ 0 ] = "Region C";
$chart [ 'chart_data' ][ 3 ][ 1 ] = 56;
$chart [ 'chart_data' ][ 3 ][ 2 ] = 21;
$chart [ 'chart_data' ][ 3 ][ 3 ] = 5;
$chart [ 'chart_data' ][ 3 ][ 4 ] = 90;
zeigt er die daten wunderbar an . Wenn ich mein array verwende welches ich per abrage mit mysql selbst geschrieben habe zeigt er nix an
Vielleicht hat ja einer von euch nen tip also die Datenbank habe ich in diesem Fall auch angesprochen
Folgende index.php wird per include von meiner hauptseite in eine tabelle projiziert.
index.php------------------->>>>
<table cellspacing="1" cellpadding="2" border="0" bgcolor="<?php echo $_SESSION['$colorx_9'];?>" WIDTH="<?php echo $_SESSION['cms_width_correction'];?>">
<tr>
<td bgcolor="<?php echo $_SESSION['$colorx_7'];?>" class="small" width="<?php echo $_SESSION['cms_width_correction_130'];?>">
<table cellpadding="2" cellspacing="5" border="0">
<tr>
<td valign="top" class="news">
<table cellspacing="0" cellpadding="1" border="0" bgcolor="<?php echo $_SESSION['$colorx_6'];?>"><tr><td>
<table cellspacing="0" cellpadding="1" border="0" bgcolor="<?php echo $_SESSION['$colorx_7'];?>"><tr><td>
<table cellspacing="0" cellpadding="2" border="0" bgcolor="<?php echo $_SESSION['$colorx_8'];?>"><tr><td>
<table cellspacing="0" cellpadding="1" border="0" bgcolor="<?php echo $_SESSION['$colorx_6'];?>"><tr><td>
<?php include(BASEDIR . "menu/auswahl_statistik/screen.php"); ?>
</td></tr></table>
</td></tr></table>
</td></tr></table>
</td></tr></table>
<?php include(BASEDIR . "menu/auswahl_statistik/screen_footer.php"); ?>
</td>
<td align="center" valign="top">
<?php include(BASEDIR . "menu/auswahl_statistik/ueberschrift_top.php");
?>
<br> <br>
<?php
//include charts.php to access the InsertChart function
include "charts.php";
$_SESSION['transfer_id'] = $_POST[transfer_id];
echo InsertChart ( "charts.swf", "charts_library", "menu/auswahl_statistik/sample.php?localy=$_SESSION[chooser]&userid=$_SESSION[transfer_id] ", 400, 250 );
?>
<?php
include(BASEDIR . "menu/auswahl_statistik/ueberschrift_footer.php"); //HIER ZWISCHEN TEXT ENDE ?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" class="small" bgcolor="<?php echo $_SESSION['$colorx_d'];?>"><?php echo $_SESSION['$shell'];?></td>
</tr>
</table>
sample.php---------------------------->>>>>>>>>>>
<?php
include 'charts.php';
$server = "localhost";
$_SESSION['transfer_id'] = $_POST[userid];
$_SESSION['chooser'] = $_REQUEST[localy];
if($_SESSION['chooser']== 0) {
$user = "SECRET WEBSITE DATA"; // MySQL-Nutzer
$pass = "SECRET WEBSITE DATA"; // MySQL-Kennwort
$dbase = "SECRET WEBSITE DATA"; // Datenbank
}
if($_SESSION['chooser']== 1) {
$user = "SECRET LOCAL DATA"; // MySQL-Nutzer
$pass = "SECRET LOCAL DATA"; // MySQL-Kennwort
$dbase = "SECRET LOCAL DATA"; // Datenbank
}
$conn = @mysql_connect($server, $user, $pass);
if($conn) {
mysql_select_db($dbase, $conn);
} else {
die("<b>Verbindung zum MySQL-Server konnte nicht hergestellt werden </b></body></html>");
}
$query = "SELECT * FROM rangliste where fk_user= $_SESSION[transfer_id] ";
$resultID = mysql_query($query) ;
$rows= mysql_num_rows($resultID);
$chart[ 'axis_category' ] = array ( 'size'=>14, 'color'=>"000000", 'alpha'=>0, 'font'=>"arial", 'bold'=>true, 'skip'=>0 ,'orientation'=>"horizontal" );
$chart[ 'axis_ticks' ] = array ( 'value_ticks'=>true, 'category_ticks'=>true, 'major_thickness'=>2, 'minor_thickness'=>1, 'minor_count'=>1, 'major_color'=>"000000", 'minor_color'=>"222222" ,'position'=>"outside" );
$chart[ 'axis_value' ] = array ( 'min'=>0, 'max'=>120, 'font'=>"arial", 'bold'=>true, 'size'=>10, 'color'=>"ffffff", 'alpha'=>50, 'steps'=>6, 'prefix'=>"", 'suffix'=>"", 'decimals'=>0, 'separator'=>"", 'show_min'=>true );
$chart[ 'chart_border' ] = array ( 'color'=>"000000", 'top_thickness'=>2, 'bottom_thickness'=>2, 'left_thickness'=>2, 'right_thickness'=>2 );
$chart [ 'chart_data' ][ 0 ][ 0 ] = "";
for($x =1 ; $x < mysql_num_rows($resultID) ; $x++){
$dsatz = mysql_fetch_assoc($resultID);
$chart [ 'chart_data' ][ 0 ][ $x] = $dsatz["monat"];
}
$chart [ 'chart_data' ][ 1 ][ 0 ] = "Region A";
for($y = 1 ; $y < mysql_num_rows($resultID2) ; $y++){
$dsatz222 = mysql_fetch_assoc($resultID2);
$chart [ 'chart_data' ][ 1 ][ $y ] = $dsatz222["punkte"];
}
$chart[ 'chart_grid_h' ] = array ( 'alpha'=>10, 'color'=>"000000", 'thickness'=>1, 'type'=>"solid" );
$chart[ 'chart_grid_v' ] = array ( 'alpha'=>10, 'color'=>"000000", 'thickness'=>1, 'type'=>"solid" );
$chart[ 'chart_pref' ] = array ( 'line_thickness'=>2, 'point_shape'=>"none", 'fill_shape'=>false );
$chart[ 'chart_rect' ] = array ( 'x'=>40, 'y'=>25, 'width'=>335, 'height'=>200, 'positive_color'=>"000000", 'positive_alpha'=>30, 'negative_color'=>"ff0000", 'negative_alpha'=>10 );
$chart[ 'chart_type' ] = "Line";
$chart[ 'chart_value' ] = array ( 'prefix'=>"", 'suffix'=>"", 'decimals'=>0, 'separator'=>"", 'position'=>"cursor", 'hide_zero'=>true, 'as_percentage'=>false, 'font'=>"arial", 'bold'=>true, 'size'=>12, 'color'=>"ffffff", 'alpha'=>75 );
$chart[ 'draw' ] = array ( array ( 'type'=>"text", 'color'=>"ffffff", 'alpha'=>15, 'font'=>"arial", 'rotation'=>-90, 'bold'=>true, 'size'=>50, 'x'=>-10, 'y'=>348, 'width'=>300, 'height'=>150, 'text'=>"hertz", 'h_align'=>"center", 'v_align'=>"top" ),
array ( 'type'=>"text", 'color'=>"000000", 'alpha'=>15, 'font'=>"arial", 'rotation'=>0, 'bold'=>true, 'size'=>60, 'x'=>0, 'y'=>0, 'width'=>320, 'height'=>300, 'text'=>"output", 'h_align'=>"left", 'v_align'=>"bottom" ) );
$chart[ 'legend_rect' ] = array ( 'x'=>-100, 'y'=>-100, 'width'=>10, 'height'=>10, 'margin'=>10 );
$chart[ 'series_color' ] = array ( "77bb11", "cc5511" );
SendChartData ( $chart );
?>
charts.php--------------------------------->>>>>>>>>>>>>
habe ich die orginale aus dem beispiel der website genommen
Bin schon echt am verzweifeln, da er die Tabelle ja anzeigt sobald man dem array die daten manuell zuweist.
Der Fehler müssste somit in der for schleife liegen , da die query ja auch ohnne for schleife mit manuellen daten läuft. Kann der Fehler my mysql_fetch_assoc entstehen oder ist es die for schelife ?
Danke
Kommentar