hola pude modificar un poco, pero necesito ayuda... no entiendo muy bien el codigo......
aqui les dejo el codigo: este debo modificarlo cosa que me quede una fila un ejemplo x=1-10 e Y=1-19, pero estan pares...osea 10 y 10, yo quiero 19 y 10....
Código:
<?php
$example_data = array(
array("__A__",0.0),
array("__B__",2.0),
array("__C__",3.0),
array("__D__",4.0),
array("__E__",4.4),
array("__F__",5.4),
array("__G__",5.5),
array("__H__",7),
array("__I__",7.4),
array("__J__",7.6)
);
?>
de aqui lo llamo:
Código PHP:
<?php
//Include the code
include("../phplot.php");
//Define the object
$graph = new PHPlot;
//Set some data
include("./data.php");
$graph->SetDataValues($example_data);
//Draw it
$graph->DrawGraph();
?>
aqui esta los archivos del phplot:
Código PHP:
function DrawGraph() {
if ( ($this->img) == "") {
$this->InitImage();
}
if (! is_array($this->data_values)) {
$this->DrawBackground();
$this->DrawError("No array of data in \$data_values");
} else {
if (!$this->data_color) {
$this->SetDataColors(array("black"),array("black"));
}
$this->FindDataLimits(); //Get maxima and minima for scaling
$this->SetXLabelHeight(); //Get data for bottom margin
$this->SetYLabelWidth(); //Get data for left margin
if (!$this->plot_area_width) {
$this->SetPlotAreaPixels("","","",""); //Set Margins
}
if (!$this->plot_max_y) { //If not set by user call SetPlotAreaWorld,
$this->SetPlotAreaWorld("","","","");
}
if ($this->data_type == "text-data") {
$this->SetEqualXCoord();
}
$this->SetPointSize($this->point_size);
$this->DrawBackground();
$this->DrawImageBorder();
$this->SetTranslation();
$this->DrawPlotAreaBackground();
//$foo = "$this->max_y, $this->min_y, $new_miny, $new_maxy, $this->x_label_height";
//ImageString($this->img, 4, 20, 20, $foo, $this->text_color);
switch ($this->plot_type) {
case "bars":
$this->DrawPlotBorder();
$this->DrawLabels();
$this->DrawBars();
break;
case "thinbarline":
$this->DrawPlotBorder();
$this->DrawLabels();
$this->DrawThinBarLines();
break;
case "lines":
$this->DrawPlotBorder();
$this->DrawLabels();
if ( $this->data_type == "text-data") {
$this->DrawLines();
} elseif ( $this->data_type == "data-data-error") {
$this->DrawLinesError();
} else {
$this->DrawLines();
}
break;
case "area":
$this->DrawPlotBorder();
$this->DrawLabels();
if ( $this->data_type == "text-data") {
$this->DrawAreaSeries();
} else {
$this->DrawArea();
}
break;
case "linepoints":
$this->DrawPlotBorder();
$this->DrawLabels();
if ( $this->data_type == "text-data") {
$this->DrawLines();
$this->DrawDotSeries();
} elseif ( $this->data_type == "data-data-error") {
$this->DrawLinesError();
$this->DrawDotsError();
} else {
$this->DrawLines();
$this->DrawDots();
}
break;
case "points";
$this->DrawPlotBorder();
$this->DrawLabels();
if ( $this->data_type == "text-data") {
$this->DrawDotSeries();
} elseif ( $this->data_type == "data-data-error") {
$this->DrawDotsError();
} else {
$this->DrawDots();
}
break;
case "pie":
$this->DrawPieChart();
$this->DrawLabels();
break;
default:
$this->DrawPlotBorder();
$this->DrawLabels();
$this->DrawBars();
break;
}
if ($this->legend) {
$this->DrawLegend($this->legend_x_pos,$this->legend_y_pos,"");
}
}
if ($this->print_image == 1) {
$this->PrintImage();
}
} //function DrawGraph
}
Código PHP:
function SetDataValues($which_dv) {
$this->data_values = $which_dv;
//echo $this->data_values
return true;
}
espero que me ayuden......necesio modificar ese array, que quede un grafico de 19 por 10... osea x seria el de abajo es 10 e y seria el de al lado que seria 19 datos....
porfis ayudenme.....
salu2