|
multiline chart |
Posted by Rhaone on Oct-07-2013 14:10 |
|
I need make a column values right no automatic;
I think in a array with the values corresponding in this column;
I try many commands but without success;
Pour example "$c -> setCol(0, 8.48, -5, 5);" but the screen still blank (because errors certain);
Thanks for help from Brazil ...
The code is in PHP:
//(...) this is a others basic datas
$c = new XYChart ($graf_largura, $graf_altura, $graf_fundo_borda_cor, $graf_borda_linha_cor, $relevo);
//$c -> setCol(0, 8.48, -5, 5); // <----- here is the problem; without line the chart is corretly maked
$c -> setPlotArea ($margem_esq, $margem_cima, $colunas_espaco, $linhas_espaco, $linhas_altern_1, $linhas_altern_2, $lindir_cor, $linhor_cor, $linver_cor);
$legendObj = $c -> addLegend ($leg_linhas_margem_esq, $leg_linhas_margem_cima, $leg_linhas_grade, $leg_linhas_fonte, $leg_linhas_fonte_tam);
$legendObj -> setBackground (Transparent);
$textBoxObj = $c -> addTitle ($titulo_texto, $titulo_texto_fonte, $titulo_fonte_tam, $titulo_fonte_cor, $titulo_fundo_cor, $titulo_fundo_edge);
$textBoxObj -> setBackground ($titulo_efeito_fundo_cor_1, $titulo_efeito_fundo_cor_2);
$c -> yAxis -> setTitle ($titulo_leg_coluna_y, $titulo_leg_fonte_y, $titulo_leg_tam_y);
$c -> xAxis -> setLabels ($labels);
$c -> xAxis -> setLabelStep ($colunas_espaco_interv);
$c -> xAxis -> setTitle ($titulo_leg_linha);
$layer = $c -> addLineLayer2 (); // # Add a line layer to the chart (?)
$layer -> setLineWidth ($linhas_espessura);
$layer -> addDataSet ($tb_linha_1, $linha_1_cor, $linha_1_leg);
$layer -> addDataSet ($tb_linha_2, $linha_2_cor, $linha_2_leg);
$layer -> addDataSet ($tb_linha_3, $linha_3_cor, $linha_3_leg);
header ("Content-type: image/png");
print ($c -> makeChart2 (PNG));
|
Re: multiline chart |
Posted by Peter Kwan on Oct-08-2013 00:46 |
|
Hi Rhaone,
Do you mean you want to control the y-axis scale and labels? To do this, the ChartDirector API is Axis.setLinearScale. For example:
$c->yAxis->setLinearScale(30, 90, 10);
or
$c->yAxis->setLinearScale2(30, 90, array("Low", "Medium", 70, "My Label"));
As according to ChartDirector documentation, there is no setCol method for the XYChart object, so $c->setCol will result in error. In PHP systems not configured for software development, the system may not display any error message to the browser (to avoid the user from seeing the error message), so you may see a blank page. Since you are developing code, it would be easier if you can see the error message. You may consider to configure your PHP to display the error message to the browser. You may refer to PHP documentation for details.
Hope this can help.
Regards
Peter Kwan |
Re: multiline chart |
Posted by Rhaone on Oct-10-2013 06:59 |
|
Thanks ... I will searching understanding your example and apply ... nice! |
Re: multiline chart |
Posted by Rhaone on Oct-10-2013 18:19 |
|
Yes!
I add the next lines in my script and worked ...
sort ($tb_line_y);
$line_y_low = $tb_line_y [0] - $chart_margin;
$line_y_hight = $tb_line_y [count ($tb_line_y) - 1] + $chart_margin;
$c -> yAxis -> setLinearScale ($line_y_low, $line_y_hight, $chart_margin);
Thanks for Rhaone from Brazil ... |
|