Set HTML labels that can be positioined anywhere in the chart area.

The method used:

Parameters:

  • mixed $name: the option name for the label. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
  • mixed $mixvalue: a value in case the name is a string

API Tags:
Return: instance
Access: public

Example:

... $chart = new jqChart(); $chart->setTitle(array('text'=>'Combination chart')) ->setxAxis(array( "categories"=>array('Apples', 'Oranges', 'Pears', 'Bananas', 'Plums') )) ->setTooltip(array("formatter"=>$tooltip)) ->setLabels(array( "items"=>array(array( "html"=> 'Total fruit consumption', "style"=>array("left"=>"40px","top"=>"8px","color"=>"black") )) )) ; ...

Option name Type Default
items Array (See below) null
An array containing configuration for each label.
style Array null
Shared CSS styles for all labels Defaults to
array(
"color"=>'#3E576F'
}

items Array

Option name Type Default
html/td> String null
Inner HTML or text for the label. Defaults to "".
style Array null
CSS styles for each label. To position the label, use left and top like this:
array(
"left" => '100px',
"top" => '100px'
}