Hi, I just implemented the chart module, and really like it! But could someone post some example code of a working CHART_TYPE_LINE_XY or lxy chart?

Thanks very much!

Comments

sergebert’s picture

Priority: Critical » Normal
Status: Active » Closed (fixed)

I have it working. Relevant parts of the code:

1) Set the chart type:

$chart = array(
   '#type' => CHART_TYPE_LINE_XY,
   ...

2) Set the data:

foreach ($valuesToBeDisplayed as $x => $y) {
  $chart['#data'][0][] = $x;
  $chart['#data'][1][] = $y;
}

Hope this helps!

kabslock’s picture

Thanks...it was very helpful for me!