pData
void pData()
这个函数创建一个新的pData对象。这个对象将被用于在所有数据入口的步骤。数据将被提取使用此对象GetData()和GetDataDescription()。
$DataSet = new pData();
// This will create a new pData object
$DataSet = new pData();
ImportFromCSV
void ImportFromCSV($FileName,$Delimiter=",",$DataColumns=-1,$HasHeader=FALSE,$DataName=-1)
此功能用于导入CSV文件(本地或远程)。很多论据,都可以使用。默认列分隔符是逗号字符。// This will import the file http://my.do
$DataSet->ImportFromCSV("http://my.do
// This will import the local file path/to/myData.csv using each column as a serie
$DataSet->ImportFromCSV("path/to/myData.csv");
// .. setting the column separator to pipe
$DataSet->ImportFromCSV("path/to/myData.csv","|");
// .. import only the data from column 1
$DataSet->ImportFromCSV("path/to/myData.csv","|",1);
// .. import only the data from column 1,2 & 3
$DataSet->ImportFromCSV("path/to/myData.csv","|",array(1,2,3));
// .. the file contains an header that will be used to name the series
$DataSet->ImportFromCSV("path/to/myData.csv","|",array(1,2,3),TRUE);
// .. column 0 will be used as label for the horizontal axis
$DataSet->ImportFromCSV("path/to/myData.csv","|",array(1,2,3),TRUE,0);
// This will import the file http://my.do
$DataSet->ImportFromCSV("http://my.do
// This will import the local file path/to/myData.csv using each column as a serie
$DataSet->ImportFromCSV("path/to/myData.csv");
// .. setting the column separator to pipe
$DataSet->ImportFromCSV("path/to/myData.csv","|");
// .. import only the data from column 1
$DataSet->ImportFromCSV("path/to/myData.csv","|",1);
// .. import only the data from column 1,2 & 3
$DataSet->ImportFromCSV("path/to/myData.csv","|",array(1,2,3));
// .. the file contains an header that will be used to name the series
$DataSet->ImportFromCSV("path/to/myData.csv","|",array(1,2,3),TRUE);
// .. column 0 will be used as label for the horizontal axis
$DataSet->ImportFromCSV("path/to/myData.csv","|",array(1,2,3),TRUE,0);
..例如,与处理以下文件:
ID |
January |
February |
March |
1 |
0 |
1 |
0.5 |
2 |
1.204119983 |
4 |
2 |
3 |
4.294091292 |
9 |
4.5 |
..和进口用以下命令中的数据(假设分隔符是一个逗号):$DataSet->ImportFromCSV("path/to/myData.csv",",",array(1,2,3),TRUE,0);
$DataSet->ImportFromCSV("path/to/myData.csv",",",array(1,2,3),TRUE,0);
将填充所有的数据及数据结构等领域。
AddPoint
void AddPoint($Value,$Serie="Serie1",$Description="")
该功能可用于添加一个或多个点到一个数据系列。默认情况下点被添加到Serie1。// This will the value 25 as the last point of Serie1
$DataSet->AddPoint(25);
// This will the value 2,4,9,5,1,0 as the last point of Serie1
$DataSet->AddPoint(array(2,4,9,5,1,0));
// This will the value 12 as the last point of Serie2
$DataSet->AddPoint(12,"Serie2");
// .. and add the desciption "March" to the Serie2
$DataSet->AddPoint(12,"Serie2","March");
// This will the value 25 as the last point of Serie1
$DataSet->AddPoint(25);
// This will the value 2,4,9,5,1,0 as the last point of Serie1
$DataSet->AddPoint(array(2,4,9,5,1,0));
// This will the value 12 as the last point of Serie2
$DataSet->AddPoint(12,"Serie2");
// .. and add the desciption "March" to the Serie2
$DataSet->AddPoint(12,"Serie2","March");
AddSerie
void AddSerie($SerieName="Serie1")
这个函数可以用来添加一个系列的DataDescription对象的新数据。所有系列宣布在这个对象将是绘制在调用一个pChart类的图表功能。没有数据的变化,只有“Graphable”属性被修改。
// Generate some data...
$DataSet->AddPoint(array(2,4,9,5,1,0),"Serie1");
$DataSet->AddPoint(array(1,1,2,2,3,3),"Serie2");
$DataSet->AddPoint(array(4,2,4,2,4,2),"Serie3");
// This will mark both Serie1 & Serie2 as "graphable" but not Serie3
$DataSet->AddSerie("Serie1");
$DataSet->AddSerie("Serie2");
// Generate some data...
$DataSet->AddPoint(array(2,4,9,5,1,0),"Serie1");
$DataSet->AddPoint(array(1,1,2,2,3,3),"Serie2");
$DataSet->AddPoint(array(4,2,4,2,4,2),"Serie3");
// This will mark both Serie1 & Serie2 as "graphable" but not Serie3
$DataSet->AddSerie("Serie1");
$DataSet->AddSerie("Serie2");
AddAllSeries
void AddAllSeries()
该功能可用于将所有的graphable数据系列。他们将全部被绘制在调用一个pChart类的图表功能。没有数据的变化,只有“Graphable”属性被修改。
// Generate some data...
$DataSet->AddPoint(array(2,4,9,5,1,0),"Serie1");
$DataSet->AddPoint(array(1,1,2,2,3,3),"Serie2");
// This will mark both Serie1 & Serie2 as "graphable"
$DataSet->AddAllSeries();
// Generate some data...
$DataSet->AddPoint(array(2,4,9,5,1,0),"Serie1");
$DataSet->AddPoint(array(1,1,2,2,3,3),"Serie2");
// This will mark both Serie1 & Serie2 as "graphable"
$DataSet->AddAllSeries();
RemoveSerie
void RemoveSerie($SerieName="Serie1")
此功能可用于去除graphable的一个数据系列。他们将全部被绘制在调用一个pChart类的图表功能。没有数据的变化,只有“Graphable”属性被修改。// Generate some data...
$DataSet->AddPoint(array(2,4,9,5,1,0),"Serie1");
$DataSet->AddPoint(array(1,1,2,2,3,3),"Serie2");
// This will mark both Serie1 & Serie2 as "graphable"
$DataSet->AddAllSeries();
// This will remove the "graphable" status of Serie2
$DataSet->RemoveSerie("Serie2");
// Generate some data...
$DataSet->AddPoint(array(2,4,9,5,1,0),"Serie1");
$DataSet->AddPoint(array(1,1,2,2,3,3),"Serie2");
// This will mark both Serie1 & Serie2 as "graphable"
$DataSet->AddAllSeries();
// This will remove the "graphable" status of Serie2
$DataSet->RemoveSerie("Serie2");
SetAbsciseLabelSerie
void SetAbsciseLabelSerie($SerieName = "Name")
该功能可用于设置使用该系列(如有的话)abcisse价值
// Generate some data...
$DataSet->AddPoint(array("Jan","Feb","Mar"),"Serie1");
$DataSet->AddPoint(array(2,4,9),"Serie2");
$DataSet->AddPoint(array(1,1,2),"Serie3");
// This will mark both Serie1 & Serie2 as "graphable"
$DataSet->AddSerie("Serie2");
$DataSet->AddSerie("Serie3");
// Set Serie as abcisse label
$DataSet->SetAbsciseLabelSerie("Serie1");
// Generate some data...
$DataSet->AddPoint(array("Jan","Feb","Mar"),"Serie1");
$DataSet->AddPoint(array(2,4,9),"Serie2");
$DataSet->AddPoint(array(1,1,2),"Serie3");
// This will mark both Serie1 & Serie2 as "graphable"
$DataSet->AddSerie("Serie2");
$DataSet->AddSerie("Serie3");
// Set Serie as abcisse label
$DataSet->SetAbsciseLabelSerie("Serie1");
SetSerieName
void SetSerieName($Name,$SerieName="Serie1")
此功能可以用来设置一个系列的描述。这说明将写在何时调用drawLegend函数图
// Generate some data...
$DataSet->AddPoint(array(2,4,9),"Serie1");
$DataSet->AddPoint(array(1,1,2),"Serie2");
// This will set the name of Serie1 to "January"
$DataSet->SetSerieName("January");
// This will set the name of Serie2 to "February"
$DataSet->SetSerieName("February","Serie2");
// Generate some data...
$DataSet->AddPoint(array(2,4,9),"Serie1");
$DataSet->AddPoint(array(1,1,2),"Serie2");
// This will set the name of Serie1 to "January"
$DataSet->SetSerieName("January");
// This will set the name of Serie2 to "February"
$DataSet->SetSerieName("February","Serie2");
SetXAxisName
void SetXAxisName($Name="X Axis")
这将使一个名字的X轴,书面方式图表它背后的水平
// Give the label "Samples" to the X axis
$DataSet->SetXAxisName("Samples")
// Give the label "Samples" to the X axis
$DataSet->SetXAxisName("Samples")
SetYAxisName
void SetYAxisName($Name="Y Axis")
这将使一个名字的Y轴,书面方式图表它背后的水平
// Give the label "Temperature" to the Y axis
$DataSet->SetYAxisName("Temperature")
// Give the label "Temperature" to the Y axis
$DataSet->SetYAxisName("Temperature")
SetXAxisFormat
void SetXAxisFormat($Format="number")
有了这个功能,您可以设置X轴值的格式。今天的格式如下:
-默认使用的数目
-时间的秒数将显示为小时:mm:ss的
-日期的Unix时间戳将显示为日期
-十进制数字将显示与K /米/克单位
-自定义货币货币单位
// Set X values format as date
$DataSet->SetXAxisFormat("date")
// Set X values format as date
$DataSet->SetXAxisFormat("date")
SetYAxisFormat
void SetYAxisFormat($Format="number")
有了这个功能,您可以设置Y轴值的格式。今天的格式如下:
-默认使用的数目
-时间的秒数将显示为小时:mm:ss的
-日期的Unix时间戳将显示为日期
-十进制数字将显示与K /米/克单位
-自定义货币货币单位
// Set Y values format as date
$DataSet->SetYAxisFormat("metric")
// Set Y values format as date
$DataSet->SetYAxisFormat("metric")
SetXAxisUnit
void SetXAxisUnit($Unit="")
设置轴单位。这将被追加到轴的值。
// Give the "km" unit to the X axis
$DataSet->SetXAxisUnit("km")
// Give the "km" unit to the X axis
$DataSet->SetXAxisUnit("km")
SetYAxisUnit
void SetYAxisUnit($Unit="")
设置轴单位。这将被追加到轴的值。
// Give the "m/s" unit to the Y axis
$DataSet->SetYAxisUnit("m/s")
// Give the "m/s" unit to the Y axis
$DataSet->SetYAxisUnit("m/s")
removeSerieName
void removeSerieName($SerieName)
该功能可用于删除一个系列的描述。这说明将写在何时调用drawLegend函数的图形。删除它的名字可以使用这个功能是有用的隐藏以前使用的系列(以填补区为例)
// Generate some data...
$DataSet->AddPoint(array(2,4,9),"Serie1");
$DataSet->AddPoint(array(1,1,2),"Serie2");
// This will set the name of Serie1 to "January"
$DataSet->SetSerieName("January");
// This will set the name of Serie2 to "February"
$DataSet->SetSerieName("February","Serie2");
// Generate some data...
$DataSet->AddPoint(array(2,4,9),"Serie1");
$DataSet->AddPoint(array(1,1,2),"Serie2");
// This will set the name of Serie1 to "January"
$DataSet->SetSerieName("January");
// This will set the name of Serie2 to "February"
$DataSet->SetSerieName("February","Serie2");
GetData
void GetData()
这个函数是用来每次您要检索的数据结构中存储的pData
// Generate some data...
$DataSet->AddPoint(array(2,4,9),"Serie1");
$DataSet->AddPoint(array(1,1,2),"Serie2");
// This will display all the data stored in the DataSet
print_r($DataSet->GetData());
// Generate some data...
$DataSet->AddPoint(array(2,4,9),"Serie1");
$DataSet->AddPoint(array(1,1,2),"Serie2");
// This will display all the data stored in the DataSet
print_r($DataSet->GetData());
void GetDataDescription()
这个函数是用来每次您要检索的数据说明在pData结构中存储
// Generate some data...
$DataSet->AddPoint(array(2,4,9),"Serie1");
$DataSet->AddPoint(array(1,1,2),"Serie2");
// This will mark both Serie1 & Serie2 as "graphable"
$DataSet->AddAllSeries();
// This will set the name of Serie1 to "January"
$DataSet->SetSerieName("January");
// This will display all the data stored in the DataSet
print_r($DataSet->GetDataDescription());
pCache
void pCache($CacheFolder="Cache/")
这个函数创建一个新的pCache对象。这个对象将被用来访问处理的数据缓存。您可以optionnaly指定缓存文件夹使用。
// 这将创建一个默认的缓存文件夹的新pCache对象
$MyCache = new pCache();
// 这将创建一个新的pCache对象设置缓存文件夹到 /tmp /
$MyCache = new pCache("/tmp/");
// This will create a new pCache object with default cache folder
$MyCache = new pCache();
// This will create a new pCache object setting the cache folder to /tmp/
$MyCache = new pCache("/tmp/");
IsInCache
void IsInCache($ID,$Data,$Hash="")
此功能可以用来检查是否dataseries您目前工作已计算并存储在缓存中。这将返回TRUE或FALSE。这个函数接受作为第一个参数集,请参阅更多信息的pData类。 ID用于唯一地,区别绘图脚本。
// 这将返回TRUE,如果这张图已经呈现
$MyCache->IsInCache("Pic#1",$DataSet->GetData());
// This will return TRUE if this chart has already been rendered
$MyCache->IsInCache("Pic#1",$DataSet->GetData());
GetFromCache
void GetFromCache($ID,$Data)
此功能将检索从缓存中的图表,如果它已经存在。该图片将被发送到浏览器中一样,如果你调用中风()的pChart类函数。 ID用于唯一地,区别绘图脚本。如果缓存可以使用的图片将被发送到浏览器相同的方式,然后调用中风()函数,你的脚本没有将处理后,该行其他线路。
// 这将检查现有的复制缓存和中风它。
$MyCache->GetFromCache("Pic#1",$DataSet->GetData());
// This will check the cache for an existing copy and Stroke it.
$MyCache->GetFromCache("Pic#1",$DataSet->GetData());
WriteToCache
void WriteToCache($ID,$Data,$Picture)
使用此功能,使所提供的图表复制到您的高速缓存文件夹。此功能是强制性的pCache正常工作。此函数必须调用在你面前呈现的脚本行程结束()或渲染()调用。 ID用于唯一地,区别绘图脚本。 $数据是用来绘制图表的数据集。 $图片是pChart包含图表对象的名称。
// 这将保存在缓存文件夹中提供的图片。
$MyCache->WriteToCache("Pic#1",$DataSet->GetData(),$Picture);
// This will save the rendered picture in the cache folder.
$MyCache->WriteToCache("Pic#1",$DataSet->GetData(),$Picture);
DeleteFromCache
void DeleteFromCache($ID,$Data)
该功能可用于删除图表的缓存副本(如果存在)。 ID用于唯一地,区别绘图脚本。
// 这将删除该图表任何缓存副本。
$MyCache->DeleteFromCache("Pic#1",$DataSet->GetData());
// This will delete any cached copy of this chart.
$MyCache->DeleteFromCache("Pic#1",$DataSet->GetData());
ClearCache
void ClearCache()
调用此函数将清除缓存文件夹。
//这将清除缓存文件夹。
$MyCache->ClearCache();
pChart
void pChart($XSize,$YSize)
这个函数创建一个新的图表对象。这个对象将使用在所有的图形创建步骤。这个对象将嵌入所有pChart功能。
$MyPicture = new pChart(700,230);
// This will create a 700x230 picture
$MyPicture = new pChart(700,230);
drawBackground
void drawBackground($R,$G,$B)
该功能可用于设置图形的背景颜色。这是在很多情况下并不需要。默认的图形背景颜色设置为白色(255,255,255)
$MyPicture->drawBackground(255,0,0);
// This will draw a red background
$MyPicture->drawBackground(255,0,0);
drawRectangle
void drawRectangle($X1,$Y1,$X2,$Y2,$R,$G,$B)
此函数绘制一个矩形别名。左上角和右下角的边界阵地被用作首4个参数。最后3个参数用来设置边框的颜色。
$MyPicture->drawRectangle(10,10,100,100,255,0,0);
// This will draw a red square at (10,10)-(100,100)
$MyPicture->drawRectangle(10,10,100,100,255,0,0);
drawFilledRectangle
void drawFilledRectangle($X1,$Y1,$X2,$Y2,$R,$G,$B,$DrawBorder=TRUE,$Alpha=100)
这个函数的语法是一样的DrawRectangle的功能相同。此函数绘制一个别名填充矩形。左上角和右下角的边界阵地被用作首4个参数。最后的R,G,乙参数用于设置边框的颜色。您可以指定如果别名边界将制定和透明度$MyPicture->drawRectangle(10,10,100,100,255,0,0);
$MyPicture->drawRectangle(10,10,100,100,255,0,0,FALSE,50);
// This will draw a filled red square at (10,10)-(100,100)
$MyPicture->drawRectangle(10,10,100,100,255,0,0);
// This will draw a semi-transparent filled red square at (10,10)-(100,100)
$MyPicture->drawRectangle(10,10,100,100,255,0,0,FALSE,50);
drawRoundedRectangle
void drawRoundedRectangle($X1,$Y1,$X2,$Y2,$Radius,$R,$G,$B)
此函数绘制一个圆角矩形别名。左上角和右下角的边界阵地被用作首4个参数。参数#5代表了圆角半径。最后3个参数用来设置边框的颜色。$MyPicture->drawRoundedRectangle(10,10,100,100,10,255,0,0);
// This will draw a red square with rounded corner at (10,10)-(100,100)
$MyPicture->drawRoundedRectangle(10,10,100,100,10,255,0,0);
drawFilledRoundedRectangle
void drawFilledRoundedRectangle($X1,$Y1,$X2,$Y2,$Radius,$R,$G,$B)
这个函数的语法是一样的drawRoundedRectangle函数相同。此函数绘制一个圆角矩形填充别名。左上角和右下角的边界阵地被用作首4个参数。参数#5代表了圆角半径。最后3个参数用来设置边框的颜色。$MyPicture->drawFilledRoundedRectangle(10,10,100,100,10,255,0,0);
// This will draw a red filled square with rounded corner at (10,10)-(100,100)
$MyPicture->drawFilledRoundedRectangle(10,10,100,100,10,255,0,0);
drawCircle
void drawCircle($Xc,$Yc,$Height,$R,$G,$B,$Width=0)
此函数绘制在位置1别名圆($结晶度,$陛与指定的半径)。最后3个参数用来设置边框的颜色。宽度是用于绘制椭圆。
$MyPicture->drawCircle(100,100,50,255,0,0);
// This will draw a red circle at (100,100) with a radius of 50 pixel
$MyPicture->drawCircle(100,100,50,255,0,0);
drawFilledCircle
void drawFilledCircle($Xc,$Yc,$Height,$R,$G,$B,$Width=0)
这个函数的语法是一样的画圆函数相同。这个函数在位置绘制一个填充锯齿圆($结晶度,$陛与指定的半径)。最后3个参数用来设置边界和填充颜色。宽度是用于绘制椭圆。$MyPicture->drawFilledCircle(100,100,50,255,0,0);
// This will draw a red filled circle at (100,100) with a radius of 50 pixel
$MyPicture->drawFilledCircle(100,100,50,255,0,0);
drawEllipse
void drawEllipse($Xc,$Yc,$Height,$Width,$R,$G,$B)
在此函数绘制椭圆位置上别名($结晶度,$陛具有指定高度和宽度)。最后3个参数用来设置边框的颜色。
$MyPicture->drawEllipse(100,100,50,25,255,0,0);
// This will draw a red ellipse at (100,100) with a width of 50 pixel and height of 25 pixel
$MyPicture->drawEllipse(100,100,50,25,255,0,0);
drawFilledEllipse
void drawFilledEllipse($Xc,$Yc,$Height,$Width,$R,$G,$B)
这个函数的语法是一样的drawEllipse函数相同。这个函数在位置绘制填充椭圆别名($结晶度,$陛具有指定高度和宽度)。最后3个参数用来设置边界和填充颜色。$MyPicture->drawFilledEllipse(100,100,50,25,255,0,0);
// This will draw a red filled ellipse at (100,100) with a width of 50 pixel
// and height of 25 pixel
$MyPicture->drawFilledEllipse(100,100,50,25,255,0,0);
drawLine
void drawLine($X1,$Y1,$X2,$Y2,$R,$G,$B,$GraphFunction=FALSE)
此函数将利用1点之间的锯齿线(× 1,y1)和性(X2,Y2)。最后3个参数用来设置线条颜色。最后一个可选参数用于作出的图形函数内部调用。如果设置为TRUE,图内的线路只有部分地区将吸引。
$MyPicture->drawLine(0,0,100,100,255,0,0);
// This will draw a red line between point (0,0) and (100,100)
$MyPicture->drawLine(0,0,100,100,255,0,0);
drawDottedLine
void drawDottedLine($X1,$Y1,$X2,$Y2,$DotSize,$R,$G,$B)
此函数将利用1点之间的别名虚线(× 1,y1)和性(X2,Y2)。最后3个参数用来设置线条颜色。 #5参数用于指定点的大小(2将以此为1分,每2分)$MyPicture->drawDottedLine(0,0,100,100,10,255,0,0);
// This will draw a red dotted line between point (0,0) and (100,100)
// Dots will consist of 5 solid points followed by a hole of 5 points
$MyPicture->drawDottedLine(0,0,100,100,10,255,0,0);
drawAlphaPixel
void drawAlphaPixel($X,$Y,$Alpha,$R,$G,$B)
此函数将利用在位置1阿尔法像素(的X,Y)。 $阿尔法用于指定的透明度因子(0到100之间),最后3个参数用来设置像素的颜色。$MyPicture->drawAlphaPixel(100,100,50,255,0,0);
// This will draw a red pixel at position (100,100) and a transparency factor of 50%
$MyPicture->drawAlphaPixel(100,100,50,255,0,0);
drawFromPNG
void drawFromPNG($FileName,$X,$Y,$Alpha=100)
这个功能允许您与您的合并外部巴图图片指定的位置和透明度。$MyPicture->drawFromPNG("test.png",0,0);
$MyPicture->drawFromPNG("test.png",20,20,50);
// This will put the picture "test.png" in the top left corner
$MyPicture->drawFromPNG("test.png",0,0);
// This will put the picture "test.png" at (20-20) with 50% transparency
$MyPicture->drawFromPNG("test.png",20,20,50);
drawFromGIF
void drawFromGIF($FileName,$X,$Y,$Alpha=100)
此功能允许您与您的图形合并外部的GIF图片指定的位置和透明度。$MyPicture->drawFromGIF("test.gif",0,0);
$MyPicture->drawFromGIF("test.gif",20,20,50);
// This will put the picture "test.gif" in the top left corner
$MyPicture->drawFromGIF("test.gif",0,0);
// This will put the picture "test.gif" at (20-20) with 50% transparency
$MyPicture->drawFromGIF("test.gif",20,20,50);
drawFromJPG
void drawFromJPG($FileName,$X,$Y,$Alpha=100)
此功能允许您与您的图形合并外部JPG图片指定的位置和透明度。$MyPicture->drawFromGIF("test.jpg",0,0);
$MyPicture->drawFromGIF("test.jpg",20,20,50);
// This will put the picture "test.jpg" in the top left corner
$MyPicture->drawFromGIF("test.jpg",0,0);
// This will put the picture "test.jpg" at (20-20) with 50% transparency
$MyPicture->drawFromGIF("test.jpg",20,20,50);
setCurrency
void setCurrency($Currency)
使用此函数来设置货币符号。
$MyPicture->setDateFormat(""$");
// This will set the $ symbol
$MyPicture->setDateFormat(""$");
setDateFormat
void setDateFormat($Format)
使用此函数来设置PHP的符号的日期格式。 (见PHP文件)。默认的格式,将用于为d /平方米/年合适的日期。
$MyPicture->setDateFormat("H:i:s");
// This will set the date format to be hours:minutes:seconds
$MyPicture->setDateFormat("H:i:s");
setFontProperties
void setFontProperties($FontName,$FontSize)
这个功能是用来设置将所有绘制的图形文本函数中使用字体属性。请注意,字体名必须在当前路径! (Windows和* UX版本的PHP不处理字体完全一样)。
$MyPicture->setFontProperties("verdana.ttf",10);
// This will set the font to verdana 10 pixel height
$MyPicture->setFontProperties("verdana.ttf",10);
setGraphArea
void setGraphArea($X1,$Y1,$X2,$Y2)
阿调用此函数是强制性当创建一个图表。左上角和右下角的边界阵地被用作参数。这个区域将用来绘制图形,网格,轴及其他。调用此函数将不会作出任何事情,这只会设置图表区的界线。
$MyPicture->setGraphArea(30,20,100,80);
// This will set the graph area to (30,20)-(100,80)
$MyPicture->setGraphArea(30,20,100,80);
setFixedScale
void setFixedScale($VMin,$VMax,$Divisions=5,$VXMin=0,$VXMin=0,$XDivisions=5)
您可以使用此功能跳过自动缩放。血流速度和Vmax将用来渲染图。$MyPicture->setFixedScale(0,100);
$MyPicture->setFixedScale(0,100,5,0,100,5);
// This will set the graph scale to 0 - 100
$MyPicture->setFixedScale(0,100);
// For a scatter chart with 5 hor/ver divisions
$MyPicture->setFixedScale(0,100,5,0,100,5);
setShadowProperties
void setShadowProperties($ShadowXDistance=4,$ShadowYDistance=4,$ShadowRColor=60,$ShadowGColor=60,$ShadowBColor=60)
使用此函数来设置阴影属性。只能用于与饼图今天发生爆炸
$MyPicture->setShadowProperties();
// Activate the shadow with default settings
$MyPicture->setShadowProperties();
setLineStyle
void setLineStyle($Width=1,$DotSize=0)
此功能允许您自定义的方式线图表中绘制。此功能仅适用于在图表绘制调用(折线图,..)。您可以指定线条的宽度和,如果他们是星罗棋布。
setLineStyle(2);
setLineStyle(1,4);
// This will set line width to 2px
setLineStyle(2);
// This will set line width to 1px dotted ( 4 drawn, 4 empty..)
setLineStyle(1,4);
addBorder
void addBorder($Width=3,$R=0,$G=0,$B=0)
使用此函数添加边框图片。是carefull,划定的边界将改变所有图表组成部分的立场,因此,这一要求必须是之前的最后一个渲染方法之一!您可以指定边框的颜色和宽度。宽度和图片的高度将被修改的2倍宽度值。
$MyPicture->addBorder($Width=2);
// This will add a two pixel size border to the picture.
$MyPicture->addBorder($Width=2);
clearScale
void clearScale()
您需要调用这个函数只有当你打算利用在呈现的画面第二个图表。调用此函数将清除当前缩放参数,因此你需要再打电话,然后才作出新的图表drawScale功能。$MyPicture->clearScale();
// Reset the scaling to prepare a new chart
$MyPicture->clearScale();
clearShadow
void clearShadow()
使用此功能可关闭阴影选项。绘制阴影的时间和CPU密集。今天阴影线及曲线图准确。
$MyPicture->clearShadow();
// Deactivate the shadow functions
$MyPicture->clearShadow();
createColorGradientPalette
void createColorGradientPalette($R1,$G1,$B1,$R2,$G2,$B2,$Shades)
此功能将填补10两个RGB颜色深浅0,0,0和一万零十点零一零万调色板。这将产生灰色色调。 (调色板编号0-9将填补)$MyPicture->createColorGradientPalette(0,0,0,100,100,100,10);
// Deactivate the shadow functions
$MyPicture->createColorGradientPalette(0,0,0,100,100,100,10);
drawGraphArea
void drawGraphArea($R,$G,$B,$Stripe=FALSE)
此功能将利用图表区域的背景颜色。相同的结果,可使用drawFilledRectangle功能,给坐标manualy。红,绿,乙3个参数是用来设置填充颜色。如果带设置为TRUE,这将画在-15度45彩色薄带。
$MyPicture->drawGraphArea(250,250,250);
// This will set the background color of the graph area to a soft grey
$MyPicture->drawGraphArea(250,250,250);
drawScale
void drawScale($Data,$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1,$RightScale=FALSE)
此功能将利用这两个轴和写入值。您可以禁用设置为FALSE $ DrawTicks轴标签。 $角度可以用来旋转垂直蜱标签。 $十进制指定我们希望保持十进制值的数量。设置DrawTicks为false不会作出纵向和横向上的蜱(标签也不会写)轴。
今天有4级的计算方式:
-获取最大和最小值每系列:的ScaleMode = SCALE_NORMAL像以前的1 -但最小值设置为0:的ScaleMode = SCALE_START0 -获取该系列累计最大和最小的值:的ScaleMode = SCALE_ADDALL -一如过往的之一,但最小值设置为0:的ScaleMode = SCALE_ADDALLSTART0
这将取决于你的图形绘制,今天,只有堆积条形图可以使用SCALE_ADDALL模式的一种。绘制图表是你要修复的最小值为0,您必须使用SCALE_START0选项。
你可以只显示一个X每席标签标签使用$ SkipLabels参数。
保持$ WithMargin为false将使图表使用的所有图形区域的宽度。对于大多数图形渲染会更好。在某些情况下,你必须将其设置为TRUE(引进左,右边缘):条形图将需要它。
请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawScale($Data,$DataDescription,SCALE_NORMAL,0,0,0);
$MyPicture->drawScale($Data,$DataDescription,SCALE_NORMAL,0,0,0,TRUE,0,0,TRUE);
$MyPicture->drawScale($Data,$DataDescription,SCALE_START0,0,0,0,TRUE,0,0,TRUE);
$MyPicture->drawScale($Data,$DataDescription,SCALE_ADDALL,0,0,0,TRUE,0,0,TRUE);
// This will will draw both scales in black in automatic mode
$MyPicture->drawScale($Data,$DataDescription,SCALE_NORMAL,0,0,0);
// This can be used for bar graphs
$MyPicture->drawScale($Data,$DataDescription,SCALE_NORMAL,0,0,0,TRUE,0,0,TRUE);
// ..same but with a min value of 0
$MyPicture->drawScale($Data,$DataDescription,SCALE_START0,0,0,0,TRUE,0,0,TRUE);
// This can be used for stacked bar graphs
$MyPicture->drawScale($Data,$DataDescription,SCALE_ADDALL,0,0,0,TRUE,0,0,TRUE);
drawRightScale
void drawRightScale($Data,$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1)
此函数是一个drawScale()函数的包装。它采用了drawScale()函数相同的参数。规模值将写在图形区域的右侧。$MyPicture->drawRightScale($Data,$DataDescription,SCALE_NORMAL,0,0,0);
$MyPicture->drawRightScale($Data,$DataDescription,SCALE_NORMAL,0,0,0,TRUE,0,0,TRUE);
$MyPicture->drawRightScale($Data,$DataDescription,SCALE_START0,0,0,0,TRUE,0,0,TRUE);
$MyPicture->drawRightScale($Data,$DataDescription,SCALE_ADDALL,0,0,0,TRUE,0,0,TRUE);
// This will will draw both scales in black in automatic mode
$MyPicture->drawRightScale($Data,$DataDescription,SCALE_NORMAL,0,0,0);
// This can be used for bar graphs
$MyPicture->drawRightScale($Data,$DataDescription,SCALE_NORMAL,0,0,0,TRUE,0,0,TRUE);
// ..same but with a min value of 0
$MyPicture->drawRightScale($Data,$DataDescription,SCALE_START0,0,0,0,TRUE,0,0,TRUE);
// This can be used for stacked bar graphs
$MyPicture->drawRightScale($Data,$DataDescription,SCALE_ADDALL,0,0,0,TRUE,0,0,TRUE);
drawXYScale
void drawXYScale(&$Data,&$DataDescription,$YSerieName,$XSerieName,$R,$G,$B,$Angle=0,$Decimals=1)
该函数使用散点图。它将计算需要提请相关的路线图和一切阴谋。您必须指定两个系列将作为X和Y数据使用的名称。默认情况下此函数将计算分和两个系列的最大价值,反正你也可以通过电话先setFixedScale功能的自动缩放。
请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawXYScale($Data,$DataDescription,"Serie1","Serie2",0,0,0);
$MyPicture->drawXYScale($Data,$DataDescription,"Serie1","Serie2",0,0,0,45);
// This will will draw both scales in black in automatic mode
$MyPicture->drawXYScale($Data,$DataDescription,"Serie1","Serie2",0,0,0);
// This can be used for bar graphs with X labels rotated
$MyPicture->drawXYScale($Data,$DataDescription,"Serie1","Serie2",0,0,0,45);
drawGrid
void drawGrid($LineWidth,$Mosaic=TRUE,$R=220,$G=220,$B=220,$Alpha=255)
此函数将绘制在图表区域的网格。 $线宽将被传递给drawDottedLine功能。红,绿,乙3个参数用来设置网格颜色。马赛克设置为true,将利用两行之间的灰色地带。您可以定义的马赛克与阿尔法参数领域的透明度,公平的因素。
$MyPicture->drawGrid(4,FALSE,0,0,0);
$MyPicture->drawGrid(4,TRUE);
// This will will draw a black grid over the graph area.
$MyPicture->drawGrid(4,FALSE,0,0,0);
// This will will draw a soft grid over the graph area with greyed area.
$MyPicture->drawGrid(4,TRUE);
drawLegend
void drawLegend($XPos,$YPos,$DataDescription,$R,$G,$B,$Rs=-1,$Gs=-1,$Bs=-1,$Rt=0,$Gt=0,$Bt=0,$Border=FALSE)
此函数将提请图传说在指定的位置(系列颜色及系列的名称)。的R,G和B参数用于设置背景颜色。您可以选择阴影颜色提供使用卢比,气孔,旅馆参数。您还可以自定义文字颜色用RT,亿吨,Bt基因。设置为false消除边界周围的框。
请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawLegend(30,30,$DataDescription,255,255,255);
// This will will draw the name of the series at (30-30) in a white buble
$MyPicture->drawLegend(30,30,$DataDescription,255,255,255);
drawPieLegend
void drawPieLegend($XPos,$YPos,$Data,$DataDescription,$R,$G,$B)
此功能将提请饼图图图例(系列颜色及值的名称)。是carrefull,使用的饼图数据集不是比其他线路相同/曲线/图图。您可以指定的传说中的位置和背景颜色。请参阅有关如何使用数据集的信息数据结构的帮助。
$MyPicture->drawPieLegend(10,10,$Data,$DataDescription,250,250,250);
// This will will draw the data values names at (10-10) with a light grey background
$MyPicture->drawPieLegend(10,10,$Data,$DataDescription,250,250,250);
drawTextBox
void drawTextBox($X1,$Y1,$X2,$Y2,$Text,$Angle=0,$R=255,$G=255,$B=255,$Align=ALIGN_LEFT,$Shadow=TRUE,$BgR=-1,$BgG=-1,$BgB=-1,$Alpha=100)
使用此功能可写在图片中的文字。您必须指定的坐标框,文本将被写入使用(× 1,Ŷ1) - (χ2,Y2)参数,文本角度以及与红,绿,乙参数文本颜色。您可以选择文本将与对齐参数一致:
- ALIGN_TOP_LEFT使用框左上角。
- ALIGN_TOP_CENTER使用框顶部中间的一个角落。
- ALIGN_TOP_RIGHT使用框的右上角。
- ALIGN_LEFT使用中心的左边。
- ALIGN_CENTER使用的中心。
- ALIGN_RIGHT使用中心的权利。
- ALIGN_BOTTOM_LEFT使用框左下角。
- ALIGN_BOTTOM_CENTER使用框底部中心角落。
- ALIGN_BOTTOM_RIGHT使用框右下角。
使用阴影参数来定义,如果文本将拥有了阴影。指定的BGR,BgG,德国民法典将利用相关的填充颜色的文本区。阿尔法参数将被applyed文本框的背景。$MyPicture->drawTextBox(0,210,700,230,"My text goes here",0,255,255,255,ALIGN_RIGHT,TRUE,0,0,0,30);
// This will will draw a text box with a black background and a transparency of 30%
// the text will be written in white with a shadow
$MyPicture->drawTextBox(0,210,700,230,"My text goes here",0,255,255,255,ALIGN_RIGHT,TRUE,0,0,0,30);
drawTitle
void drawTitle($XPos,$YPos,$Value,$R,$G,$B,$XPos2=-1,$YPos2=-1,$Shadow=FALSE)
这个功能是用来写图题。使用默认参数,您必须指定底部用左文本的位置。如果您指定的$ X2和$ Y2文本将被集中horizontaly并在箱verticaly坐标(× 1,Ŷ1) - (χ2,Y2)。 $值对应的则是将图稿。 $ṛ,$ $ G和B是用来设置文字的颜色。设置为true的阴影使文本背后的阴影。
$MyPicture->drawTitle(100,15,"This is the title",0,0,0);
// This will write in black "This is the title" at coordinate (100,15)
$MyPicture->drawTitle(100,15,"This is the title",0,0,0);
drawTreshold
void drawTreshold($Value,$R,$G,$B,$ShowLabel=FALSE,$ShowOnRight=FALSE,$TickWidth=4,$FreeText=NULL)
此函数将利用一个横向treshold(这是一个简单的方法来绘制0线)。如果$ ShowLabel设置为TRUE,该treshold价值将超过图写的。如果$ ShowOnRight设置为TRUE,该值将在图表的右侧写的。 $ṛ,$ $ G和B是用来设置行和文本颜色。使用$ TickWidth设置的蜱,如果设置为0,将以此为实线的宽度。您可以optionnaly提供的treshold(默认值的treshold使用说明)
$MyPicture->drawTreshold(0,255,0,0);
// This will draw a red line at vertical coordinate 0 ( using the graph coordinates system )
$MyPicture->drawTreshold(0,255,0,0);
setLabel
void setLabel($Data,$DataDescription,$SerieName,$ValueName,$Caption,$R=210,$G=210,$B=210)
此函数将绘制在图表的标签。您必须指定数据及DataDescription结构,系列名称(“默认情况下,如果只有一个Serie1”),是在数据数组值X位置(将数字从0开始,如果没有AbsciseLabel定义或价值选择Abscise系列如果指定),即会显示并选择标签的颜色标题。要查看示例点击这里。请参阅有关如何使用数据集的信息数据结构的帮助。$DataSet->AddPoint(array(1,4,-3,2,-3,3,2,1,0,7,4),"Serie1");
$MyPicture->setLabel($Data,$DataDescription,"Serie1","2","Important point!");
$DataSet->AddPoint(array(1,2,0),"Serie1");
$DataSet->AddPoint(array("Jan","Feb","Mar"),"Serie2");
$DataSet->SetAbsciseLabelSerie("Serie2");
$MyPicture->setLabel($Data,$DataDescription,"Serie1","Feb","February record!");
// This will put a label containing the text "Important point!" on the 3rd point of Serie1 (-3)
$DataSet->AddPoint(array(1,4,-3,2,-3,3,2,1,0,7,4),"Serie1");
$MyPicture->setLabel($Data,$DataDescription,"Serie1","2","Important point!");
// This will put a label containing the text "February record!" on the 2nd point of Serie1 (2)
$DataSet->AddPoint(array(1,2,0),"Serie1");
$DataSet->AddPoint(array("Jan","Feb","Mar"),"Serie2");
$DataSet->SetAbsciseLabelSerie("Serie2");
$MyPicture->setLabel($Data,$DataDescription,"Serie1","Feb","February record!");
drawArea
void drawArea($Data,$Serie1,$Serie2,$R,$G,$B,$Alpha = 50)
此功能将利用两个数据系列的地区提取的每个X职位的最低和最高的价值。您必须指定两个系列的名称和该地区的颜色。您可以指定这是默认设置为50%的透明度。要查看示例点击这里。请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawArea($DataSet->GetData(),"Serie1","Serie3",239,238,227,50);
// This will draw an area between Serie1 and Serie3 with a transparency of 50%.
$MyPicture->drawArea($DataSet->GetData(),"Serie1","Serie3",239,238,227,50);
drawGraphAreaGradient
void drawGraphAreaGradient($R,$G,$B,$Decay,$Target=TARGET_GRAPHAREA)
您可以使用此功能来填充颜色渐变模式的图片或图表区域的背景。您必须指定与它的R,G,B值起始的颜色,数量的色彩运用与衰减参数和optionnaly目标可以:
- TARGET_GRAPHAREA当前定义的图形区域
- TARGET_BACKGROUND,整幅照片的背景$MyPicture->drawGraphAreaGradient(132,153,172,50,TARGET_BACKGROUND);
// This will draw a background gradient made of 50 shades of the 132,153,172 color
$MyPicture->drawGraphAreaGradient(132,153,172,50,TARGET_BACKGROUND);
drawRadarAxis
void drawRadarAxis($Data,$DataDescription,$Mosaic=TRUE,$BorderOffset=10,$A_R=60,$A_G=60,$A_B=60,$S_R=200,$S_G=200,$S_B=200,$MaxValue=-1)
此功能将利用一个雷达图的轴。您可以指定偏移量将适用于绘图区域,外部边界和内部轴颜色和最大的价值。马赛克设置为false不会作出蛛网之间的灰色领域。
$MyPicture->drawRadarAxis($Data,$DataDescription);
$MyPicture->drawRadarAxis($Data,$DataDescription,TRUE,20,0,0,0,200,200,200,10);
// This will draw the radar graph axis with auto settings
$MyPicture->drawRadarAxis($Data,$DataDescription);
// This will draw the radar graph axis with a border of 20px, black
// axis, soft grey inner axis, using 10 as max value.
$MyPicture->drawRadarAxis($Data,$DataDescription,TRUE,20,0,0,0,200,200,200,10);
setColorPalette
void setColorPalette($ID,$R,$G,$B)
这个函数可以用来改变一个系列的颜色。系列编号是从0开始了相关的数据系列#1。你必须提供一个RGB颜色。
$MyPicture->setColorPalette(0,255,0,0);
// This will set the color of the first serie to red
$MyPicture->setColorPalette(0,255,0,0);
loadColorPalette
void loadColorPalette($FileName,$Delimiter=",")
此函数将负载从一个文本文件的配色方案。此文件必须格式化三个每行上(R,G和B)值。默认情况下,分隔符是昏迷,但你可以指定它。$MyPicture->loadColorPalette('includes/palette.txt','|');
// This will load the palette from file includes/palette.txt using semicolon as delimiter
$MyPicture->loadColorPalette('includes/palette.txt','|');
reportWarnings
void reportWarnings($Interface="CLI")
使用此摇杆,使错误的图表呈现在报告。默认情况下,邮件将被重定向到控制台在使用渲染命令和使用GD在使用中风命令。您可以强制错误重定向到广东或CLI或指定的参数。$MyPicture->reportWarnings();
$MyPicture->reportWarnings("GD");
// Enable error reporting
$MyPicture->reportWarnings();
// Enable error reporting and redirect to GD
$MyPicture->reportWarnings("GD");
void writeValues($Data,$DataDescription,$Series)
您可以使用此功能来显示对上了排行榜系列中包含的值。它可以指定一个或多个系列,以显示使用和数组。
$MyPicture->writeValues($Data,$DataDescription,"Serie1");
$MyPicture->writeValues($Data,$DataDescription,array("Serie2","Serie3"));
// This will show the values of Serie1 on top of the charts
$MyPicture->writeValues($Data,$DataDescription,"Serie1");
// This will show the values of Serie2 and Serie3 on top of the charts
$MyPicture->writeValues($Data,$DataDescription,array("Serie2","Serie3"));
drawPlotGraph
void drawPlotGraph(&$Data,&$DataDescription,$BigRadius=5,$SmallRadius=2,$R2=-1,$G2=-1,$B2=-1,$Shadow=FALSE)
此函数将以此为阴谋图使用所有已注册的系列。只给数据及DataDescription结构将以此为基本情节图,您可以指定半径(外部和内部的阴谋)。您还可以指定点的颜色(将在多个系列案件唯一的)。你可以在这里看到一个样本叠加1线和图形的阴谋。阴影设置为true将以此为根据情节的影子。请参阅有关如何使用数据集的信息数据结构的帮助$MyPicture->drawPlotGraph($Data,$DataDescription);
// This will draw a plot graph using automatic sizing and coloring
$MyPicture->drawPlotGraph($Data,$DataDescription);
drawXYPlotGraph
void drawXYPlotGraph(&$Data,&$DataDescription,$YSerieName,$XSerieName,$PaletteID=0,$BigRadius=5,$SmallRadius=2,$R2=-1,$G2=-1,$B2=-1)
这个功能是非常相似的drawPlotGraph功能。您必须指定两个系列将作为X和Y坐标使用的名称和颜色身份证使用。请参阅有关如何使用数据集的信息数据结构的帮助$MyPicture->drawXYPlotGraph($Data,$DataDescription,"Serie1","Serie2");
// This will draw a plot scatter using Serie1 as Y and Serie2 as X
$MyPicture->drawXYPlotGraph($Data,$DataDescription,"Serie1","Serie2");
drawLineGraph
void drawLineGraph($Data,$DataDescription)
此函数将以此为线图使用所有已注册的系列。你可以在这里看到一个样本叠加1线和图形的阴谋。此函数不具有可选的参数,这是最基本的:)请参阅有关如何使用数据集的信息数据结构的帮助
$MyPicture->drawLineGraph($Data,$DataDescription);
// This will draw a line graph
$MyPicture->drawLineGraph($Data,$DataDescription);
drawXYGraph
void drawXYGraph(&$Data,&$DataDescription,$YSerieName,$XSerieName,$PaletteID=0)
此函数将以此为分散线图。您必须指定X和Y系列,将被使用。您可以optionnaly设置当前调色板的颜色索引。$MyPicture->drawXYGraph($Data,$DataDescription,"Serie1","Serie2");
// This will draw a line scatter chart using Serie1 as Y and Serie2 as X
$MyPicture->drawXYGraph($Data,$DataDescription,"Serie1","Serie2");
drawFilledLineGraph
void drawFilledLineGraph($Data,$DataDescription,$Alpha=100,$AroundZero=FALSE)
此函数将以此为填充线图使用所有已注册的系列。你可以在这里看到一个样本。您可以提供Alpha值时使用的一系列合并所有层。如果$ AroundZero设置为TRUE,将绘制0轴线之间的路线图和价值的地区。请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawLineGraph($Data,$DataDescription);
// This will draw a line graph
$MyPicture->drawLineGraph($Data,$DataDescription);
drawCubicCurve
void drawCubicCurve($Data,$DataDescription,$Accuracy)
此函数将以此曲线图使用所有已注册的系列。你可以在这里看到一个样本叠加曲线和图表的阴谋。这条曲线是使用立方algorythm处理两点之间的平均值。您必须指定两点之间的精确度,typicaly 0.1值是可以接受的。该值越小,时间越长会来处理图形。请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawCubicCurve($Data,$DataDescription,.1);
// This will draw a cubic curve graph
$MyPicture->drawCubicCurve($Data,$DataDescription,.1);
drawFilledCubicCurve
void drawFilledCubicCurve($Data,$DataDescription,$Accuracy,$Alpha=100,$AroundZero=FALSE)
此函数将以此为填充曲线图使用所有已注册的系列。你可以在这里看到一个样本叠加曲线和图表的阴谋。这条曲线是使用立方algorythm处理两点之间的平均值。您必须指定两点之间的精确度,typicaly 0.1值是可以接受的。该值越小,时间越长会来处理图形。您可以提供Alpha值时使用的一系列合并所有层。如果$ AroundZero设置为TRUE,将绘制0轴线之间的路线图和价值的地区。请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawFilledCubicCurve($Data,$DataDescription,.1,50);
// This will draw a filled cubic curve graph with a transparency of 50%
$MyPicture->drawFilledCubicCurve($Data,$DataDescription,.1,50);
drawLimitsGraph
void drawLimitsGraph($Data,$DataDescription,$R=0,$G=0,$B=0)
此功能将以此为最低和最高值为特定使用所有已注册的一系列问题。你可以在这里看到一个样本。您可以optionaly指定颜色的垂直线。请参阅有关如何使用数据集的信息数据结构的帮助。
$MyPicture->drawLimitsGraph($Data,$DataDescription);
// This will draw a limit graph
$MyPicture->drawLimitsGraph($Data,$DataDescription);
drawBarGraph
void drawBarGraph($Data,$DataDescription,$Shadow=FALSE)
此函数将以此为条形图使用所有已注册的系列。你可以在这里看到一个样本。当创建一个条形图,不要忘记设置drawScale函数$ WithMargin参数设置为TRUE。 $阴影设置为TRUE,将以此为每个系列背后的阴影,这也将稍微放缓的渲染引擎。请参阅有关如何使用数据集的信息数据结构的帮助。
$MyPicture->drawBarGraph($Data,$DataDescription,TRUE);
// This will draw a bar graph with shadows
$MyPicture->drawBarGraph($Data,$DataDescription,TRUE);
drawStackedBarGraph
void drawStackedBarGraph($Data,$DataDescription,$Alpha=50,$Contiguous=FALSE)
此函数将以此为堆积条形图使用所有已注册的系列。你可以在这里看到一个样本。当创建一个条形图,不要忘记设置drawScale函数$ WithMargin参数设置为TRUE。不要忘记更改自动扩展到SCALE_ADDALL有一个准确的缩放模式。您可以指定的透明度,如果酒吧必须是连续的或与空间(默认),请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawStackedBarGraph($Data,$DataDescription,70);
// This will draw a stacked bar graph with a transparency of 70%
$MyPicture->drawStackedBarGraph($Data,$DataDescription,70);
drawOverlayBarGraph
void drawOverlayBarGraph($Data,$DataDescription,$Alpha=50)
此函数将以此为叠加条形图使用所有已注册的系列。你可以在这里看到一个样本。您可以提供Alpha值时使用的一系列合并所有层。请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawOverlayBarGraph($Data,$DataDescription);
// This will draw a bar graph with a default alpha factor of 50
$MyPicture->drawOverlayBarGraph($Data,$DataDescription);
drawRadar
void drawRadar($Data,$DataDescription,$BorderOffset=10,$MaxValue=-1)
此函数将以此为雷达图使用所有已注册的系列。你可以在这里看到一个样本。你可以提供一个边界偏移量和最大值(必须是不是与一致性DrawRadarAxis函数中使用的相同),请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawRadar($Data,$DataDescription);
// This will draw a line radar graph
$MyPicture->drawRadar($Data,$DataDescription);
drawFilledRadar
无效drawFilledRadar($数据,$ DataDescription,$阿尔法= 50,$ BorderOffset = 10元,MaxValue的=- 1)本函数将以此为填充雷达图使用所有已注册的系列。你可以在这里看到一个样本。你可以提供一个边界偏移量和最大值(必须是不是与一致性DrawRadarAxis函数中使用的相同),您还可以提供层的透明度因素是默认设置为50%。请参阅帮助更多的信息数据结构关于如何使用数据集。 $MyPicture->drawFilledRadar($Data,$DataDescription);
// This will draw a line radar graph
$MyPicture->drawFilledRadar($Data,$DataDescription);
drawPieGraph
void drawPieGraph($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$EnhanceColors=TRUE,$Skew=60,$SpliceHeight=20,$SpliceDistance=0,$Decimals=0)
此函数将绘制三维馅饼图。为此,您必须指定数据及DataDescription数组。只有一个数据系列,是允许馅饼图。你可以通过标记关联它使用SetAbsciseLabelSerie()函数的另一系列中的每个值的说明。您必须指定图表的中心地位。您还可以选择指定的馅饼的半径,如果比率应该打印,三维扭曲因素,所有接头的高度。如果$ EnhanceColors设置为TRUE,饼边将得到加强。如果SpliceDistance大于0努力创造,馅饼会爆炸。您可以指定小数要在标签(默认显示的数字是0)。
默认情况下没有标签约有饼图写的。您可以使用参数美元DrawLabels下列方式:
- PIE_NOLABEL没有任何标签显示
- PIE_PERCENTAGE百分比显示
- PIE_LABELS系列标签显示
- PIE_PERCENTAGE_LABEL系列标签和百分比显示
请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150); $MyPicture->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,50,PIE_PERCENTAGE); $MyPicture->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,100,PIE_PERCENTAGE,TRUE,30);
$MyPicture->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,100,PIE_PERCENTAGE,TRUE,30,10,10);
// This will draw a pie graph centered at (150-150) with a radius of 100, no labels
$MyPicture->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150);
// This will draw a pie graph centered at (150-150) with a radius of 50 and percentages
$MyPicture->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,50,PIE_PERCENTAGE);
// This will draw a pie graph centered at (150-150) with a radius of 100, captions and a skew factor of 30
$MyPicture->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,100,PIE_PERCENTAGE,TRUE,30);
// This will draw a pie graph (..) exploded
$MyPicture->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,100,PIE_PERCENTAGE,TRUE,30,10,10);
drawBasicPieGraph
void drawBasicPieGraph($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$R=255,$G=255,$B=255,$Decimals=0)
此函数将以此为经典非爆炸饼图。为此,您必须指定数据及DataDescription数组。只有一个数据系列,是允许馅饼图。你可以通过标记关联它使用SetAbsciseLabelSerie()函数的另一系列中的每个值的说明。您必须指定图表的中心地位。您还可以选择指定的馅饼的半径,若百分比应印。 $ṛ,$克,$ B可以用来设置行,将环绕每个扇形的颜色。您可以指定小数要在标签(默认显示的数字是0)
默认情况下没有标签约有饼图写的。您可以使用参数美元DrawLabels下列方式:
- PIE_NOLABEL没有任何标签显示
- PIE_PERCENTAGE百分比显示
- PIE_LABELS系列标签显示
- PIE_PERCENTAGE_LABEL系列标签和百分比显示
请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawBasicPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150);
$MyPicture->drawBasicPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,50,PIE_PERCENTAGE);
$MyPicture->drawBasicPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,100,PIE_PERCENTAGE,0,0,0);
// This will draw a pie graph centered at (150-150) with a radius of 100, no labels
$MyPicture->drawBasicPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150);
// This will draw a pie graph centered at (150-150) with a radius of 50 and percentages
$MyPicture->drawBasicPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,50,PIE_PERCENTAGE);
// This will draw a pie graph centered at (150-150) with a radius of 100, captions and black borders
$MyPicture->drawBasicPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,100,PIE_PERCENTAGE,0,0,0);
drawFlatPieGraph
void drawFlatPieGraph($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL ,$SpliceDistance=0,$Decimals=0)
此函数将以此为2D平面图形馅饼。为此,您必须指定数据及DataDescription数组。只有一个数据系列,是允许馅饼图。你可以通过标记关联它使用SetAbsciseLabelSerie()函数的另一系列中的每个值的说明。您必须指定图表的中心地位。您还可以选择指定的馅饼的半径,若百分比应印。如果SpliceDistance大于0努力创造,馅饼会爆炸。您可以指定小数要在标签(默认显示的数字是0)
默认情况下没有标签约有饼图写的。您可以使用参数美元DrawLabels下列方式:
- PIE_NOLABEL没有任何标签显示
- PIE_PERCENTAGE百分比显示
- PIE_LABELS系列标签显示
- PIE_PERCENTAGE_LABEL系列标签和百分比显示
请参阅有关如何使用数据集的信息数据结构的帮助。$MyPicture->drawFlatPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150);
$MyPicture->drawFlatPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,50,PIE_PERCENTAGE);
$MyPicture->drawFlatPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,100,PIE_PERCENTAGE,4);
// This will draw a pie graph centered at (150-150) with a radius of 100, no labels
$MyPicture->drawFlatPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150);
// This will draw a pie graph centered at (150-150) with a radius of 50 and percentages
$MyPicture->drawFlatPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,50,PIE_PERCENTAGE);
// This will draw a pie graph centered at (150-150) with a radius of 100, captions and slightly exploded
$MyPicture->drawFlatPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,150,100,PIE_PERCENTAGE,4);
drawFlatPieGraphWithShadow
void drawFlatPieGraphWithShadow(&$Data,&$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$SpliceDistance=0,$Decimals = 0)
这个函数是drawFlatPieGraph函数的别名。$MyPicture->drawFlatPieGraphWithShadow($DataSet->GetData(),$DataSet->GetDataDescription(),150,150);
// This will draw a pie graph centered at (150-150) with a radius of 100, no labels
$MyPicture->drawFlatPieGraphWithShadow($DataSet->GetData(),$DataSet->GetDataDescription(),150,150);
getLegendBox
array getLegendBox($DataDescription)
这个函数的宽度和评估由drawLegend产生的盒子的高度。这将帮助您计算dynamicaly的位置上,你想打印(如右上)。您必须提供作为唯一的参数datadescription数组。这个函数将返回和数组的第一行框的宽度遏制和在第二行框的高度。请参阅有关如何使用数据集的信息数据结构的帮助。$BoxSize = $MyPicture->getLegendBox($DataSet->GetDataDescription());
$Test->drawLegend(590-$BoxSize[0],10,$DataSet->GetDataDescription(),255,255,255);
// Retrieve the width and height of the legend box
$BoxSize = $MyPicture->getLegendBox($DataSet->GetDataDescription());
// Print the legend box always aligned in the top right corner with a padding of 10px
// assuming your pChart graph width is 600px
$Test->drawLegend(590-$BoxSize[0],10,$DataSet->GetDataDescription(),255,255,255);
setImageMap
void setImageMap($Mode=TRUE,$GraphID="MyGraph")
使用此函数启动图像的地图,将相关的图表记录。模式必须设置为TRUE开始录制。 GraphID必须是一个独特的标识符,将用于检索图像映射使用Ajax技术。该图像地图将被写入磁盘,同时要求这两个渲染方法之一。
$MyPicture->setImageMap(TRUE,"Zob4458");
// This will start the recording of the "Zob4458" image map.
$MyPicture->setImageMap(TRUE,"Zob4458");
getImageMap
getImageMap($MapName,$Flush=TRUE)
使用此函数来检索图像映射。大多数情况下此功能是用来回答一个Ajax异步请求的时间。您必须指定图像映射的唯一ID(只要在创建与setImageMap函数中)。默认情况下影像地图被刷新一旦发送到浏览器,您可以保留通过设置冲洗参数为FALSE他们。如果图像地图无法找到404头被发送到浏览器。调用此函数将停止执行该脚本。$MyPicture->getImageMap("Zob4458",FALSE);
资料来源:http://www.phpchina.com/home/space.php?uid=162164&do=blog&id=183339