Is it possible to define color for labels. I don't want that dark gray.
I want that my labels (for 3d pie graf) are dark green or red?

Is it possible to do that?

Comments

tjholowaychuk’s picture

A fellow posted a comment at the bottom of this page using a scatter chart with green / red labels, might want to check out his code

http://code.google.com/p/drupal-chart-api/wiki/Examples

quickcel’s picture

A little more followup to tjholowaychuk. It looks like you can style labels for only certain types of charts such as line, bar, radar, and scatter charts. You can check out more info from the google chart api: http://code.google.com/apis/chart/labels.html#axis_styles_labels

The code sample below (taken from - http://snippets.dzone.com/posts/show/5985) shows you how to use '#mixed_axis_labels' to pass through styling parameters:

$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][0][] = chart_mixed_axis_range_label(0, $sqlcnt + 1);
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t(' '));    
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('members'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t(' '));    
 
$chart['#mixed_axis_labels'][CHART_AXIS_Y_LEFT][2][] = chart_mixed_axis_range_label(0, 1000);
$chart['#mixed_axis_labels'][CHART_AXIS_Y_LEFT][3][] =  chart_mixed_axis_label(t(' '));
$chart['#mixed_axis_labels'][CHART_AXIS_Y_LEFT][3][] =  chart_mixed_axis_label(t('flyDollars'));
$chart['#mixed_axis_labels'][CHART_AXIS_Y_LEFT][3][] =  chart_mixed_axis_label(t(' '));


//label colors
$chart['#mixed_axis_label_styles'][] = array(0,'000000',10);
$chart['#mixed_axis_label_styles'][] = array(1,'000000',10);
$chart['#mixed_axis_label_styles'][] = array(2,'0000ff',15);
$chart['#mixed_axis_label_styles'][] = array(3,'00ff00',15);
13rac1’s picture

Status: Active » Fixed

Looks fixed to me. fora, re-open if needed.

Status: Fixed » Closed (fixed)

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

Pierre.Vriens’s picture

Title: How to define label color » How to specify the colors of the labels
Component: Miscellaneous » Code
Issue summary: View changes

Adapting title to link to this issue from the Chart HowTos docu ...