I can't found in current version of module how I can set custom labels to x and y axises and try to create a patch for this functionality. Patch is attached.
We can set the axis labels like in this example:

 $chart = array(
'#plugin' => 'google_charts', 
'#type' => 'line2D',
'#height' => 100,
'#width' => 600, 
'#axislabel' => array('x' => 'Jan|Feb|Mar', 'y' => "0|50|100"),
array(1,2,3,4,5)
);
echo charts_chart($chart);

And I try to create a max-min values working, but in simple coding they isn't work. Will this module have switching from 'Simple encoding' to 'Text encoding' ( http://code.google.com/apis/chart/#data_scaling ) in future?

Comments

brmassa’s picture

Assigned: Unassigned » brmassa

Alexey,

nice feature. I will implement it for sure. however, i will do a bit different, since it must be in the series scope (some other chart providers allow to overlap multiple series with different axis labels, like profit and market share)

since the module is part of Google Summer of Code, i will only release a new version when the program ends.

regards,

massa

brmassa’s picture

Alexey,

i didnt find the patch file. could you send it again?

and i forgot to reply about the Text encoding: i will only add this feature when someone (maybe you :P) provide some patch. since simple encoding generates a smaller string, the program should be smart enough to switch modes on real time.

regards,

massa

murz’s picture

StatusFileSize
new1.76 KB

Patch is here.

brmassa’s picture

Status: Needs review » Fixed

Alexey,

sorry for the long waiting. commited! soon on the next release.

regards,

massa

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

univate’s picture

Version: 6.x-1.0-alpha4 » 6.x-1.x-dev
Status: Closed (fixed) » Reviewed & tested by the community

This patch has not been applied to the alpha5 or dev releases - it still applies fine and works.

kenorb’s picture

any news?

rashad612’s picture

Charts module is under study/development to fix bugs and provide new releases.

cristhian’s picture

Hey, I think the patch never commited, I've checked alpha4, 5 6 and dev.. and when I try to use the patch, it shows an error.. can't be done.. does anyone know anything? I worked on a similar patch, should I post it?

cristhian’s picture

StatusFileSize
new4.77 KB
cristhian’s picture

StatusFileSize
new4.05 KB

Oops, do not use the first one I posted..

cluther’s picture

This patch was posted on Feb. 8. Has it made it into the module yet? (unfortunately I don't know how to tell).

So far I am unable to get the code sample to work... trying to debug.

Thanks in advance for any suggestions.

Chris

apaatsio’s picture

How about support for multiple axes of the same type? The previous patch supports only one set of labels per axis type because it uses the axis type as the array key in $data['#axis']. I suggest we add a key #type to the axis settings. So the axis settings would look something like this:

$data['#axis'][] = array(
  '#type' => 'x',
  '#labels' => array('foo'),
  // etc
);

Here's an example of Google Chart with multiple axes of the same type: http://chart.apis.google.com/chart?cht=bvg&chs=300x200&chd=s:H1LatB&chxt...|Q1|Q2|Q3|Q4|Q1|Q2|1:|2010||||2011||2012

apaatsio’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new4.47 KB

This one's based on the patch in #11. I added the feature I suggested in #13.

cristhian’s picture

I can't see great difference between patch #11 and #14, #11 actually supports $data['#axis']['#type'], doesn't?
By the way, is there someone still maintaining this module? No changes have been made since february or before.

apaatsio’s picture

The patch #11 has this:

foreach($data['#axis'] as $key => $value) {
  $axis[] = $key;
  //...
}

It uses the array keys as the axis type. Since you can't use the same key twice in an array in PHP, obviously, there's no way to create multiple axes of the same type.

quicksketch’s picture

Status: Needs review » Closed (won't fix)

These features are supported in the 7.x-2.x version of the module. The D6 version of the module is no longer being updated.