0
동일한 이미지에서 두 개의 차트를 생성하는 데 어려움을 겪고 있습니다. 이 순간에 내가 가지고있는 문제는 내가 접근법을 사용할 때 어떤 나쁜 결과를 얻는다는 것입니다. 출력 그림에서 알 수 있듯이 첫 번째 차트에는 두 개의 세로 축이 있습니다. 두 번째 차트에만 두 개의 수직 축이 필요합니다.pchart를 사용하여 한 이미지의 두 차트
내 코드가 좋지 않거나 접근 방법이 좋지 않다고 가정합니다. pchart를 사용하여 동일한 이미지에 두 개의 차트를 어떻게 생성합니까? 이 문제는 동일한 이미지에 두 개의 세로 축과 여러 차트가 필요할 때만 도착합니다.
내 코드 :
<?php
include("../pchart/class/pData.class.php");
include("../pchart/class/pDraw.class.php");
include("../pchart/class/pImage.class.php");
$MyData = new pData();
$MyData->addPoints(array(-4,VOID,VOID,12,8,3),"probe1");
$MyData->addPoints(array(3,12,15,8,5,-5),"probe2");
$MyData->addPoints(array(2,7,5,18,19,22),"probe3");
$MyData->addPoints(array(14,12,10,8,9,12),"probe4");
$MyData->addPoints(array(3,4,5,7,6,4),"probe5");
$MyData->setAxisName(0,"Temperatures");
$MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun"),"Labels");
$MyData->setSerieDescription("Labels","Months");
$MyData->setAbscissa("Labels");
$MyData->setSerieOnAxis("probe4", 1);
$MyData->setAxisPosition(1,AXIS_POSITION_RIGHT);
$MyData->setSerieDrawable (array("probe4", "probe5"), FALSE);
$myPicture = new pImage(700,400,$MyData);
$myPicture->drawRectangle(0,0,699,399,array("R"=>0,"G"=>0,"B"=>0));
$myPicture->setFontProperties(array("FontName"=>"../pchart/fonts/Forgotte.ttf","FontSize"=>11));
$myPicture->drawText(250,55,"Average temperature",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
$myPicture->setGraphArea(60,60,670,190);
$myPicture->drawFilledRectangle(60,60,670,190,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10));
$myPicture->drawScale(array("DrawSubTicks"=>TRUE));
$myPicture->drawLineChart(array("DisplayValues"=>TRUE,"DisplayColor"=>DISPLAY_AUTO));
$MyData->setSerieDrawable (array("probe1", "probe2", "probe3"), FALSE);
$MyData->setSerieDrawable (array("probe4", "probe5"), TRUE);
$myPicture->setGraphArea(60,240,670,370);
$myPicture->drawFilledRectangle(60,240,670,370,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10));
$myPicture->drawScale(array("DrawSubTicks"=>TRUE));
$myPicture->drawLineChart(array("DisplayValues"=>TRUE,"DisplayColor"=>DISPLAY_AUTO));
$myPicture->stroke();
?>