JPGragph로 그래프를 만들려고하는데 계속 오류가 발생합니다.
JpGraph Error A plot has an illegal scale. This could for example be that you are trying to use text auto scaling to draw a line plot with only one point or that the plot area is too small. It could also be that no input data value is numeric (perhaps only '-' or 'x')
$ydata = round($ydata[0]); // An attempt to convert float to int
$ydata = (int)$ydata; // That didn't bring any solution(thought it couldn't handle float)
$pt = new LinePlot($ydata); // Here is where the error is thrown
$bar2->Add($pt);
$pt->SetColor("blue");
$pt->SetWeight(10);
$ ydata를 정수로 바꾸려고 시도했지만 치명적인 오류 만 발생합니다.
라운드 및 유형 캐스트가 없으면 $ ydata의 var_dump입니다.
array(1) { [0]=> float(8.1102970953135) }
플롯에 데이터 포인트가 하나만 포함되어있을 때 PHP 7.2를 사용하여 동일한 문제가 발생했습니다. 그 이유는 JPGraph가 단일 데이터 포인트를 플롯의 왼쪽과 오른쪽 가장자리에 동시에 배치하려고하기 때문인 것 같습니다.
사용 $plot->SetCenter();
하면 문제가 해결되었으며 BoxPlots에서 더 좋아 보입니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다