Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When chart labels are long (or there are several different labels), they often times are truncated as if they go off the edge of the image. One work-around for this is to add margins to your chart URI like so: &chma=50,50,50,50.
I thought it would be great if you could add margins to a chart URL like this:
$my_chart['awesome_chart'] = array('#chart_id' => 'awesome_chart',
'#title' => t('What a great chart'),
'#type' => CHART_TYPE_PIE_3D,
'#size' => chart_size(500, 300),
'#margins' => '50, 50, 50, 50',
);
I patched the chart.module to allow for this. Patch attachment forthcoming.
Comment | File | Size | Author |
---|---|---|---|
#4 | add_margins-691904-4.patch | 2.45 KB | 13rac1 |
#2 | 691904.patch | 1.15 KB | axlroach |
#1 | 691904.patch | 0 bytes | axlroach |
Comments
Comment #1
axlroach CreditAttribution: axlroach commentedHere's the patch file:
Comment #2
axlroach CreditAttribution: axlroach commentedWhoops. Here's a patch file that actually has data in it:
Comment #3
solemanus CreditAttribution: solemanus commentedThis patch produces a Hunk error at line 274.
Comment #4
13rac1 CreditAttribution: 13rac1 commentedFunctionality and support function chart_margins() committed to 7.x-1.x. Patch needs to be ported to 6.x-1.x.
Comment #5
13rac1 CreditAttribution: 13rac1 commentedManually applied to 6.x-1.x-dev.