ChartDirector Ver 3.1 (PHP Edition Edition)

BaseChart.gradientColor


Usage

gradientColor(startX, startY, endX, endY, startColor, endColor)

Description

Create a two-point gradient color.

Arguments

ArgumentDefaultDescription
startX(Mandatory)The x coordinate of the starting point of the gradient line segment.
startY(Mandatory)The y coordinate of the starting point of the gradient line segment.
endX(Mandatory)The x coordinate of the ending point of the gradient line segment.
endY(Mandatory)The y coordinate of the ending point of the gradient line segment.
startColor(Mandatory)The starting color.
endColor(Mandatory)The ending color.

Return Value

Return a 32-bit integer acting as a handle to the gradient color. The handle can be used in any ChartDirector API that expects a color as an argument.


e>

Return Value

Return a 32-bit integer acting as a handle to the gradient color. The handle can be used in any ChartDirector API that expects a color as an argument.


irector does not include the <map> and </map> tag. This is intentional so that you can add additional custom <area> tags to the image map.

The type of query parameters to append to the URL depends on the chart type. The default query parameters are as follows.

Chart/Layer TypeDefault Query Format
Pie chart sector={sector}&label={label}&value={value}&percent={percent}
Bar, Line, Spline, Step Line, Area and Scatter layers x={x}&xLabel={xLabel}&dataSet={dataSet}&dataSetName={dataSetName}&value={value}
Percentage Bar and Percentange Area layers x={x}&xLabel={xLabel}&dataSet={dataSet}&dataSetName={dataSetName}&value={value}&percent={percent}
HLOC and CandleStick layers x={x}&xLabel={xLabel}&high={high}&low={low}&open={open}&close={close}
Box-Whisker layer x={x}&xLabel={xLabel}&top={top}&bottom={bottom}&max={max}&min={min}&med={med}
Trend layer dataSetName={dataSetName}

The texts in curly brackets (e.g. {sector}, {dataSet}, etc.) will be replaced by the actual values when generating the image map. For example, {sector} will be replaced by the sector number of the sector.

ChartDirector allows developers to modify the query parameters by using the queryFormat argument. For example, if "x={x}&v={value}" is used as the queryFormat for a XYChart, only the x position and the value of the data point will be included in query parameters.

Please refer to Parameter Substitution and Formatting on all available parameters and their meanings.

In addition to customizing the query parameters, ChartDirector supports additional HTML attributes in the <area> tags by using the extraAttr argument.

For example, the following extraAttr will add an "alt" HTML attribute to every <area> tag. The attribute which will contain the x-axis label and the value of the data point. The "alt" attribute will be displayed as "tool tip" when the mouse moves over the image map.

alt='{xlabel}:{value}'

Another common usage of the extraAttr argument is to add "onmouseover" and "onmouseout" HTML attributes to handle user interaction using Javascript on the browser.

Arguments

ArgumentDefaultDescription
url(Mandatory)The URL to be used in the "href" attribute of the image map. Parameter substitution and formatting is supported. If no href attribute is needed (e.g. the image map is for onmouseover events only), use an empty string as the URL.
queryFormat""A text string representing the template of the query parameters to be appended to the URL. Parameter substitution and formatting is supported. An empty string means the default query parameters will be used (see table above). To disable query parameters, use a space chartacter as the queryFormat.
extraAttr""A text string to specify additional attributes to add to the <area> tag. Parameter substitution and formatting is supported.
offsetX0An offset to be added to all x coordinates in the image map. This is useful if the current image will be shifted and inserted into another image. In this case, the image map will need to be shifted by the same offset.
offsetY0An offset to be added to all y coordinates in the image map. See offsetX above for description.

Return Value

A text string containing the image map generated.


d>lowess(Self)Fit a curve through the data points in the ArrayMath object using the LOWESS algorithm.lowess2(Self)Fit a curve through the data points in the ArrayMath object using the LOWESS algorithm, where the spacing of the data points is supplied by the given array.result(Self)Get the content of the ArrayMath object as a normal array to be used in other ChartDirector API.max(Self)Get the maximum value of the elements of the ArrayMath object.min(Self)Get the minimum value of the elements of the ArrayMath object.avg(Self)Get the average value of the elements of the ArrayMath object.sum(Self)Get the total value of the elements of the ArrayMath object.med(Self)Get the median value of the elements of the ArrayMath object.percentile(Self)Get the required percentile value of the elements of the ArrayMath object.maxIndex(Self)Get the index of the maximum value element of the ArrayMath object.minIndex(Self)Get the index of the minimum value element of the ArrayMath object.
(1059, '1999-03-01', '371', '635', '722');