ChartDirector Ver 3.1 (PHP Edition Edition)

Axis.addLabel


Usage

addLabel(pos, label)

Description

Add an extra label on the axis.

Arguments

ArgumentDefaultDescription
pos(Mandatory)The position on the axis to add the label.
label(Mandatory)The text label to add.

Return Value

None


/div>

his is by selecting the dates/times in the data array only if it is not the same year as the previous element in the array. The selected elements will be left unchanged, while the elements not select will be replaced by NoValue. The resulting array can be used directly in Axis.setLabels2.

For the first data point, there is no previous data point to compare, so it is handled differently. The first data point will be selected if it is near the beginning of the year it represents. By default, near means within 60 days (5184000 seconds). This is configurable using the initialMargin argument.

Note that if the data points does not have data in a certain time range, no element can be selected in that time range, and so there will be no tick for that time range. This is appropriate for many chart types, such as finance charts, in which missing time ranges (non-trading hours, holidays, etc) are traditionally skipped.

However, if the data points may contain missing time ranges, but the ticks cannot be skipped, it may be more appropriate to use a non-enumerated x-axis by using Layer.setXData and Axis.setDateScale3 (or Axis.setDateScale or Axis.setDateScale2).

Arguments

ArgumentDefaultDescription
majorTickStep1The tick step. The default value of 1 means one tick per year. A value of n means one tick per n years.
initialMargin5184000The margin for the first data point. The first data point will be selected if it is within initialMargin number of seconds from beginning of the year it represents. The default is 60 days (5184000 seconds).

Return Value

The current ArrayMath object.


HTML> d>selectStartOfHour(Self)Select the elements of the ArrayMath object that represents a different hour from the previous element.selectStartOfDay(Self)Select the elements of the ArrayMath object that represents a different day from the previous element.selectStartOfWeek(Self)Select the elements of the ArrayMath object that represents a different week from the previous element.selectStartOfMonth(Self)Select the elements of the ArrayMath object that represents a different month from the previous element.selectStartOfYear(Self)Select the elements of the ArrayMath object that represents a different year from the previous element.trim(Self)Trim the ArrayMath object by keeping only some elements in the middle.insert(Self)Insert the elements of an array to the ArrayMath object.insert2(Self)Insert some constant elements to the ArrayMath object.replace(Self)Find elements that are equal to a given value and replace it with another value.movAvg(Self)Replace each element of the ArrayMath object by its moving average.expAvg(Self)Replace each element of the ArrayMath object by its exponential average.movMed(Self)Replace each element of the ArrayMath object by its moving median.movPercentile(Self)Replace each element of the ArrayMath object by its moving percentile.movMax(Self)Replace each element of the ArrayMath object by its moving maximum.movMin(Self)Replace each element of the ArrayMath object by its moving minimum.movStdDev(Self)Replace each element of the ArrayMath object by its moving standard deviation.movCorr(Self)Replace each element of the ArrayMath object by the moving correlation with another array or with itself.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');