|
moveGridBefore() |
Posted by marcel on Feb-14-2013 20:00 |
|
servus,
I'm beginning ChDir(PHP).
I took an original sample and changed it to my first try:
.
.
.
# Add an overlay area layer with three data sets //orig: stack
$layer = $c->addAreaLayer2(Overlay); //orig: addAreaLayer2(Stack)
$layer->addDataSet($data0, 0x4040ff, "minima");
$layer->addDataSet($data1, 0xff4040, "maxima");
//$layer->addDataSet($data2, 0x40ff40, "Store #3");
$layer->setBaseLine(-30);
#to get the grid before both layers:
$plotAreaObj->moveGridBefore("maxima");
# Output the chart
header("Content-type: image/PNG");
$c->makeChart("c:/UniServer/www/MinMaxJanuar.PNG");
print($c->makeChart2(PNG));
.
.
.
.....and got following message:
<<Fatal error: Error converting argument 1 to type class Layer * in C:\\UniServer\\www\\ChartDirector\\lib\\phpchartdir.php on line 2431>>
how should I name the layers in other way?
moveGridBefore([layer]) needs "null" or a pointer to a layer.
how to do that?
http://www.chartdir.com/forum/insert.php says:
"ChartDirector Ver 5.0 allows a layer to be inserted in front or behind another layer. It also allows the grid lines to be inserted in front of a given layer, instead of always behind all layers. " HOW??
Second question:
attached image: why have I to choose the sequence order 1. "minima" (blue) and 2. "maxima" (red) AFTER "minima", allthough "max" lays BEHIND "min"?? I thought, the order is given by the order in code? building up a picture, you are beginning with background and OVER it your draw your trees and last apples and birds in it
I KNOW: "an XY Chart is determined by the order that the layers are added to the chart, >>>with the first layer in the front<<<", but I feel it illogical.
thanks for supporting a beginner
Marcel
|
Re: moveGridBefore() |
Posted by Peter Kwan on Feb-14-2013 21:04 |
|
Hi marcel,
To move the grid lines in front of the area layer, please use:
#$layer is the variable referencing your AreaLayer
$plotAreaObj->moveGridBefore($layer);
For the ordering of the layers or data series, since the first version of ChartDirector, the drawing order is that the first data series will be in front of the second data series. For compatibility reasons, this ordering will be maintained for all future versions of ChartDirector.
The reason we chose this ordering is that we are considering the legend keys in the legend box. We guessed that most people will expect the first item in the legend box will be the layer in front, and the second item in the legend box will be the layer behind it, and people may expect the ordering in the legend box be the same as the order that the layers are added to the chart. That's why the first layer, which is the first item in the legend box, stays in front.
Hope this can help.
Regards
Peter Kwan |
Re: moveGridBefore() |
Posted by marcel on Feb-15-2013 17:53 |
|
servus, Peter!
first thx for the immidiate answer.
1. (moveGridBefore):
and I thought, I had tried that for a hundred times,; NO, obviously not: it works perfect, but now I dont like its appearance. perhaps I should change color/style of grid or something else; anyway: thanks :-o
second (order of layers): thats ok, I understand - most people wont expect to draw pictures on their lap.
once more- thanks, you make a good job; I like the program, but I'll have to try further on befor purchasing ChDir.
best regards
Marcel |
|