line 322 of highcharts.options.inc

    $options->yAxis->plotLines = (object) array(
      'value' => 0,
      'width' => 1,
      'color' => '#808080',
    );

should be

    $options->yAxis->plotLines[] = (object) array(
      'value' => 0,
      'width' => 1,
      'color' => '#808080',
    );

in case the subclass wants to define more than 1 plotline

Comments

scottrigby’s picture

@djdevin do you mean a custom class that extends HighchartsOptionsLineBasic?

If so, couldn't you just do this?

  public function render() {
    $options = parent::render();

    // Override template options here.
    $options->yAxis->plotLines = $this->myPlotlinesArray;

    return $options;
  }

OTOH if you mean overriding the option through the Views UI, highcharts_views_options_override() will override the original yAxis.plotLines option altogether.

This brings up a related Views UI / options override question we considered long ago - there is still no good way I can think of to allow adding objects through the Views UI (when objects are desired - I think we still need custom modules to do this). Do you have any thoughts on that?

djdevin’s picture

The Highcharts examples have it using an array:

http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.co...

Doesn't really matter how it's overridden, you might have a HighchartsOptionsLineBasicWithMarkers that will more simply modify the plotLines while inheriting HighchartsOptionsLineBasic's properties.

Also good to stick to what the API is expecting though, not sure why/how it even works when not an array.