setChart
Top  Previous  Next

setChart (integer Chart, GR_BAR[, integer Classes=8, integer Gauss=0, string TitleX, string TitleY] )
or
setChart
(integer Chart, GR_LINE[, integer Classes=8, integer Gauss=0, string TitleX, string TitleY ])
or
setChart
(integer Chart, GR_PIE [, integer Classes =8, integer Legend =1, string Title )
or
setChart
(integer Chart, GR_3D [, integer Classes1 =8, integer Classes2 =8, integer Angle =45,
string TitleX1, string TitleX2, string TitleY ] )  
or
setChart
(integer Chart, GR_SCATTER[, integer Fit=1, integer Power=1, string TitleX, string TitleY ])
or
setChart
(integer Chart, GR_MULTI [, integer Classes =8, integer Angle =45 ] )


Use this function to change the type and appearance of an existing chart. Depending on the type of the graph submitted as the first argument, the rest of the argument list will have different syntax.

Arguments
 
Chart  
 
An integer between 1 and 100 specifying the ID of the chart to be changed.  
 
Type  
 
An enumerated integer specifying the type of the graph to be set. Must be one of the following values:  
 
GR_BAR – data will be plotted in form of bar histogram. Measurement histograms illustrate the distribution of object population over a measurement range. The histogram's X-scale identifies the parameter's range (from its minimum value to its maximum value), and the Y-scale measures the number of objects within each measured interval. Data values in the bar histogram are represented by vertical bars.        
 
GR_LINE – data will be plotted in form of line histogram. Analogous to the bar histogram except that data values in the line histogram are represented by connected straight-line segments.  
 
GR_PIE – data will be plotted in form of round diagram. The round diagram displays the distribution of the selected parameter among the measured parameter's range. The segments of the diagram correspond to the percentage of objects within each measured interval.     
 
GR_3D – plots two measurements in form of 3D-histogram, where the X1-axis represent the value of the first parameter, the X2-axis represents the value of the second parameter, and the Y-axis measures the number of objects with the values of both parameters falling within corresponding intervals. Data values in the bar histogram are represented by vertical pillars.  
 
GR_SCATTER – plots two measurements against each other. Scattergrams are used to illustrate a correlation between two measurements. ImageWarp displays the scattergram along with its correlation factor and the best-fit line drawn through the points.  
 
GR_MULTI – plots the histograms of several measurements next to each other in a 3D-form. X-axis represents the measured parameter, the X2-axis serves as a divider between different data series, and the Y-axis measures the number of objects within each interval. Data values in the multi-histogram are represented by vertical pillars.  
 
Classes1  
 
An integer between 2 and 50 specifying the number of intervals into which the measured parameter's range will be divided. This corresponds to the number of classes displayed along the X-axis of the histogram graphs or the number of segments in the Pie diagram.  
Default value: 8  
 
Classes2  
 
An integer between 2 and 50 specifying the number of intervals into which the range of values of the second parameter will be divided. This corresponds to the number of classes displayed along the X2-axis of the 3D-histogram.  
Default value: 8  
 
Fit  
 
A boolean integer specifying weather the best-fit line should be plotted on the Scattergram.  
Default value: TRUE  
 
Power  
 
An integer between 1 and 10 specifying the power of the polynom to be used to build the best-fit line for the Scattergram.  
Default value: 1  
 
Gauss  
 
A boolean integer specifying weather a Gaussian curve will be plotted on the bar or line histogram chart. The Gaussian represents a normal distribution with the same mean and standard deviation that the plotted measurement parameter has.  
Default value: FALSE  
 
Legend  
 
A boolean integer specifying weather the legend will be displayed next to the graph. A legend is a box that identifies colors assigned to different classes on the Pie diagram.  
Default value: TRUE  
 
TitleX, TitleY…  
 
Strings specifying descriptive text displayed along the corresponding axes. Default values for these arguments are determined by the selected type of the graph.  
 
Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  
 
Example
 
This set of statements measures objects on a sample image and displays a 3D-histogram of two measured parameters and then changes the chart type to the Scattergram:  
 
SelectParam("Area","Perim","DCircle","DMin","DMax")  
grabim(1)  
threshunimod(1,1,0,1)  
scrap(1,1,50,400,1)  
measobjects(1,1,"")  
setChartAttr(GR_3D,8,5)  
createChart(1,"","Area",0, "DMin",0)  
wait(2000)  
setChart (1, GR_SCATTER)