I needed to add a line chart overlay to an existing bar chart.
As http://code.google.com/apis/chart/image/docs/gallery/compound_charts.html states, it's only a matter of explicitly setting the data series count in the chd property and setting the line markers via chm.

Suppose you have 3 series of data and another one to overlay. You just populate the data array with the 4 series as usual, being the overlay series the last one to be populated.
When done, just set #data_series explicitly to 3 and adjust markers like this:


  //Populate your 4 data series

  $chartg['#data_series'] = 3;
  $chartg['#shape_markers'] = array(array('D','000000',3,0,3));

  //Render your chart as usual

The above #shape_markers array will draw a 2px wide black line (D) using the third data series.
It's working for me on both dev and prod sites.

I was aware of #1250720: Line Markers and Circle Markers integration for making Composite Charts through Views, but it was not working for me. Since I want to modify as little as possible the prod site and I'm afraid of using -dev code in a prod site I did it this way. I just changed my patch original property name to #data_series to match -dev when it gets stable in the future.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amontero’s picture

13rac1’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Needs review » Needs work

No patch is attached and patches must go against -dev. Please use the -dev code to correct any recent issues. Thanks!

amontero’s picture

Hi eosrei.
Gotta go home now. If it's reviewed ok, I will gladly apply it to -dev.
Thanks.

amontero’s picture

Here's the -dev targetted patch. I'm aware that fixes and feats should go against dev, but I patched against 1.1 because it was the branch I'm currently using in the prod site. Posting here would allow reviewing and maybe help others in my situation.
Patch against 7.x-1.1 branch reposted here for clarity, it's the txt attachment.

amontero’s picture

Status: Needs work » Needs review
amontero’s picture

Is there anything more I can do to make this into -dev?
It is meant to be ignored if property not set. It's working for me on 2 prod and some dev sites with no problem to date. I thought in rerolling against -mk, but since I'm using the API directly without views, -dev seems fine.
TIA.

13rac1’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Issue # link markup