|
interlinelayer not working when x,y are swapped |
Posted by John B on May-05-2015 06:31 |
|
I have created an interlinelayer color with two lines (y,x)
$Fdata, $xrisk
$Zdata, $xrisk
where $Fdata >= $Zdata
$F = $cRisk->addLineLayer($Fdata, $lineFolor3);
$F->setXData($xrisk);
$Z = $cRisk->addLineLayer($Zdata, $lineFolor3);
$Z->setXData($xrisk);
$Farea = $cRisk->addInterLineLayer($F->getLine(), $Z->getLine(), 0x5070DB70);
My problems occurs when I chart the lines with the y and x-axis swapped
$F1 = $cRisk->addLineLayer($xrisk, $lineFolor3);
$F1->setXData($Fdata);
$Z1 = $cRisk->addLineLayer($xrisk, $lineFolor3);
$Z1->setXData($Zdata);
$F1area = $cRisk->addInterLineLayer($F1->getLine(), $Z1->getLine(), 0x5070DB70);
I get no interlinelayer coloring
Any ideas ?? |
Re: interlinelayer not working when x,y are swapped |
Posted by Peter Kwan on May-06-2015 00:06 |
|
Hi John B,
There are infinitely many ways to fill between two lines. I have attached an image to show
two such possibilities - horizontal filling and vertically fill. To avoid ambiguity, the
InterLineLayer fills only along the y-axis direction, which is the most common method.
For your case, instead of swapping the x and y coordinates, please swap the x and y axes.
In this way, the y-axis is horizontal. As the InterLineLayer fills along the y-axis, it will fill
horizontally.
$F = $cRisk->addLineLayer($Fdata, $lineFolor3);
$F->setXData($xrisk);
$Z = $cRisk->addLineLayer($Zdata, $lineFolor3);
$Z->setXData($xrisk);
$Farea = $cRisk->addInterLineLayer($F->getLine(), $Z->getLine(), 0x5070DB70);
$cRisk->swapXY();
Hope this can help.
Regards
Peter Kwan
|
|