You are here

function ChartCanvas::__construct in Charts and Graphs 6

Same name and namespace in other branches
  1. 7.2 charts_graphs.class.inc \ChartCanvas::__construct()
  2. 7 charts_graphs.class.inc \ChartCanvas::__construct()

Constructor function.

<p>ATTENTION: This function should NOT be called directly. You should always instantiate a chart implementation class using chart_graphs_get_graph() factory function.

<p>CAUTION: PHP does not implicitely call parent constructors. DO NOT override this function, or if you do: make sure to call it from the child implementation with: parent::__contrusct(); within the child constructor.

File

./charts_graphs.class.inc, line 108
abstract class ChartCanvas.

Class

ChartCanvas
Each graphing library implementation should create a derivative of this class.

Code

function __construct($modulename) {
  $this->modulename = $modulename;
  $this->unique_id = chart_graphs_chart_id_generator();

  // Set some default values
  $this->width = 500;
  $this->height = 250;
  $this->title = t("A Drupal Chart");
}