bar chart - force baseline zero

Created on 31 October 2014, over 10 years ago
Updated 6 January 2025, about 2 months ago

Hi, trying to get this bar chart to force zero as the baseline (y-intercept). It seems to start at 20% no matter what I try. Help please.

  $chart = array(
    '#type' => 'chart',
    '#chart_type' => 'bar',
    '#title' => t('Scores'),
  );
  $chart['male'] = array(
    '#type' => 'chart_data',
    '#title' => t('Score'),
    '#data' => array($score),
    '#suffix' => '%',
  );
  $chart['xaxis'] = array(
    '#type' => 'chart_xaxis',
    '#labels' => array('Your Score'),
  );

 $output .= drupal_render($chart);
πŸ’¬ Support request
Status

Closed: outdated

Component

Chart API

Created by

πŸ‡°πŸ‡ΎCayman Islands docwilmot

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024