I have generat a Line Char. Now I set one value to zero. The line graph disappear in certain sections, why? What is it for a chart if I put no value on zero
<?php
$chart = array(
'#chart_id' => 'test_chart',
'#title' => chart_title(t('Servings'), 'cc0000', 15),
'#type' => CHART_TYPE_LINE,
'#size' => chart_size(400, 200),
'#adjust_resolution' => TRUE,
);
$chart['#data']['months'] = array(1, 2, 0, 4, 2,6,7,8,9,1,0,12);
//$chart['#legends'][] = t('Fruits');
//$chart['#legends'][] = t('Meats');
//$chart['#legends'][] = t('Dairy');
$chart['#data_colors'][] = '00ff00';
$chart['#data_colors'][] = 'ff0000';
$chart['#data_colors'][] = '0000ff';
$chart['#mixed_axis_labels'][CHART_AXIS_Y_LEFT][0][] = chart_mixed_axis_range_label(0, 5);
//$chart['#mixed_axis_labels'][CHART_AXIS_Y_LEFT][1][] = chart_mixed_axis_label(t('Count'), 95);
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('jan'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('feb'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('mar'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('apr'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('mai'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('jul'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('jun'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('aug'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('sep'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('okt'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('nov'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label(t('dez'));
echo chart_render($chart);
?>
Comments
Comment #1
Hacky commentedThe output looks like:
Comment #2
13rac1 commentedCan you try this again in the current development version? I checked this in the current 7.x dev (which is nearly the same code) and it renders correctly. Resulting chart URL: http://chart.googleapis.com/chart?chd=t%3A7%2C15%2C0%2C31%2C15%2C47%2C55...|jan|feb|mar|apr|mai|jul|jun|aug|sep|okt|nov|dez&chxt=y%2Cx&chxp=
If working, please set to fixed.
Comment #3
13rac1 commentedA month passed w/o response. Re-open if needed.