Hi,
I have the following code for creating a map in Drupal 7 however only the title is showing, could someone point me to where I'm going wrong?
$map = array(
'#chart_id' => 'visits_by_country',
'#type' => CHART_TYPE_MAP, //Map Type
'#countries' => array('MG','KE','TN'), //Array of ISO country codes (2 letter codes)
'#georange' => 'africa', //Geographic Range of the Map - continent name or 'world'
'#data' => array(10,50,100), //Value affects intensity of colours which will be in the range defined by #data_colours second and third elements
'#data_colors' => array('ffffff', 'edf0d4', '13390a'), //3 values for the colour (all other countries, start colour and end colour)
'#size' => array('#width' => 750, '#height' => 250),
'#title' => t('5616'), '#436C30', 15,
);
$page_content .= theme('chart', array('chart' => $map));
Many thanks
Comments
Comment #1
StChat commentedreplace '#size' line with this
'#size' => chart_size(750, 250),
it works but not for all values .. I have no idea why.
Comment #2
pwhite commentedThanks for that, unfortunately its still not working - any other ideas?
Comment #3
StChat commentedI have found out that chart_size is actually the same with the array(). You can try (440,220) that works for me but greater values do not. Someone enlighten us...
Comment #4
13rac1 commentedCan you post the generated API URL?
Comment #5
pwhite commented//chart.googleapis.com/chart?chd=t%3A10%2C50%2C100&cht=t&chs=440x220&chtt=5616&chco=ffffff%2Cedf0d4%2C13390a&chf=&chld=MGKETN&chtm=africa
Comment #6
13rac1 commentedThe above chart is working, but there are image size limitations. See: https://developers.google.com/chart/image/docs/chart_params#gcharts_chs
Comment #7
Pierre.Vriens commentedNot sure what the current status of this issue is. Can anyone update the issue accordingly please? If not I suggest to consider it closed (fixed).
Comment #8
Pierre.Vriens commentedAbout 1 week later no feedback received. Therefor I'm updating this issue. Feel free to reopen if needed.