1. roberto.aloi
  2. highcharts-php
  3. Issues
Issue #7 new

yAxis title doesn´t work

Anonymous created an issue

I tried the example you put on this page, the chart displays right but I can´t change the yAxis title, it just show: "Y-values".

this is my code:

{{{

!php

$options = array( 'chart' => array( 'renderTo' => 'my_graph', 'defaultSeriesType' => 'area' ), 'title' => array( 'text' => 'Gasto m3/seg ' ), 'xAxis' => array( 'categories' => $d1, 'title' => 'Horas' ),

                    'yAxis' => array(
                        'title' => array(
                            'text' => 'My Values'
                        ),
                    ),

                     'series' => array(
                                       array(
                                             'name' => 'Gasto',
                                             'data' => $d1
                                             ),
                                       array(
                                             'name' => 'Volumen',
                                             'data' => $d2
                                             )
                                       )
                     );

}}}

do you know how to fix this?

thank you

Comments (2)

  1. Anonymous

    hmcfdb say:

    I fixed this and it is running good.:

      private function build_option($key, $options)
      {
        $code = $key . ': ';
        if (!is_array(reset($options)))
          $code .= $this->build_properties($options);
        else
          {
            if ($key != 'series') {
            		$code .= '{';
            		if (is_array($options)) {
           		   foreach ($options as $k => $v){
            		      $code .= $k.': ';
            		   }
            		}
            } else {
            $code .= '[';
            }
            $opts = array();
            foreach ($options as $option)
              {
                $opts []= $this->build_properties($option);
              }
            $code .= implode(',', $opts);
            if ($key != 'series') {
            		$code .= '}';
            } else {
            $code .= ']';
            }
          }
        return $code;
      }
    
  2. Log in to comment