Implemented from \Altamira\JsWriter\Ability\Legendable
@see \Altamira\JsWriter\Ability\Legendable::setLegend()
@param array $opts
@return \Altamira\JsWriter\JqPlot
14938
public function setLegend( array $opts = array('on'       => 'true', 
                                                   'location' => 'ne', 
                                                   'x'        => 0, 
                                                   'y'        => 0 ) )
    {
        extract( $opts );
        
        $on       = isset( $on )       ? $on       : true;
        $location = isset( $location ) ? $location : 'ne';
        $x        = isset( $x )        ? $x        : 0;
        $y        = isset( $y )        ? $y        : 0;
        
        
        if (! $on ) {
            unset( $this->options['legend'] );
        } else {
            $legend = array();
            $legend['show'] = true;
            if ( $location == 'outside' || $location == 'outsideGrid' ) {
                $legend['placement'] = $location;
            } else {
                $legend['location'] = $location;
            }
            if ( $x != 0 ) {
                $legend['xoffset'] = $x;
            }
            if ( $y != 0 ) {
                $legend['yoffset'] = $y;
            }
            $this->options['legend'] = $legend;
        }

        return $this;
    }
511874
public function setOptions(array $options)
    {
        if (isset($options['indent'])) {
            $this->indent = $options['indent'];
        }
        if (isset($options['quote'])) {
            $this->quote = $options['quote'];
        }
        if (isset($options['foregroundColors'])) {
            $this->foregroundColors = $options['foregroundColors'];
        }
        if (isset($options['backgroundColors'])) {
            $this->backgroundColors = $options['backgroundColors'];
        }
        return $this;
    }
1285281
public function useHighlighting(array $opts = array('size'=>7.5))
    {
        $this->highlighting = true;

        return $this->setNestedOptVal( $this->options, 'grid', 'hoverable', true )
                    ->setNestedOptVal( $this->options, 'grid', 'autoHighlight', true );
    }
331609
protected function _options(array $opts)
    {
        if (!empty($opts['saveStrategy'])) {
            $this->setSaveStrategy($opts['saveStrategy']);
        }
        if (isset($opts['sort'])) {
            $this->setSort($opts['sort']);
        }
    }
908431
public function setOptions(array $options)
    {
        foreach ($options as $index=>$val) {
            if (property_exists($this, $index)) {
                $this->{$index} = $val;
            }
        }
        return $this;
    }
738663
public function setShadow( $opts = array( 'use'    =>    true, 
                                              'angle'  =>    45, 
                                              'offset' =>    1.25, 
                                              'depth'  =>    3, 
                                              'alpha'  =>    0.1 ) )
	{
	    if ( $this->jsWriter instanceOf \Altamira\JsWriter\Ability\Shadowable ) {
	        $this->jsWriter->setShadow( $this->getTitle(), $opts );
	    }
	    
		return $this;
	}
528221
public function opts(array $options)
    {
        // provide a new instance of the scheduler class if this
        // is the first method that was called.  This allows for
        // $scheduler->opts() to return a new instance of the
        // scheduler when it's first called
        if (count($this->arguments) == 0) {
            $scheduler = App::make(get_called_class());
            $scheduler->setOptions($options);

            return $scheduler;
        }

        $this->setOptions($options);

        return $this;
    }
1303107
public function setOptions(array $options)
    {
        foreach ($options as $name => $value) {
            $method = 'set' . ucfirst($name);

            if (method_exists($this, $method)) {
                $this->$method($value);
            } else {
                $this->options[$name] = $value;
            }
        }

        return $this;
    }
861247
public function envReboot($opts = [
        'include-network' => false,
    ])
    {
        $this->executeCommandHook(__FUNCTION__, 'before');
        $this->engineInstance()->reboot($opts['include-network']);
        $this->executeCommandHook(__FUNCTION__, 'after');

        return $this;
    }
797259
public function fromArray(array $opts) 
    {
        $this->_opts = \Coast\array_merge_smart(
            $this->_opts,
            $opts
        );
        return $this;
    }
96496
public function stringifyOpts($opts)
	{
		$pairs = array();
		foreach ($opts as $k => $v) {
			if (is_null($v)) {
				continue;
			}
			if ($v === true) {
				$pairs[] = $k;
			} elseif ($v === false) {
				$pairs[] = $k.'=false';
			} else {
				$pairs[] = $k.'='.$v;
			}
		}
		return implode(' ', $pairs);
	}
1305592
private function extract($opts) {
    if (!empty($opts) && is_array($opts)) {
      isset($opts['query']) && $this->setQueryString($opts['query']);
      isset($opts['indexes']) && $this->addIndex($opts['indexes']);
      isset($opts['fetch_field']) && $this->addFetchFields($opts['fetch_field']);
      isset($opts['format']) && $this->setFormat($opts['format']);
      isset($opts['formula_name']) && $this->setFormulaName($opts['formula_name']);
      isset($opts['summary']) && $this->summary = $opts['summary'];
      isset($opts['start']) && $this->setStartHit($opts['start']);
      isset($opts['hits']) && $this->setHits((int) $opts['hits']);
      isset($opts['sort']) && $this->sort = $opts['sort'];
      isset($opts['filter']) && $this->addFilter($opts['filter']);
      isset($opts['aggregate']) && $this->aggregate = $opts['aggregate'];
      isset($opts['distinct']) && $this->distinct = $opts['distinct'];
      isset($opts['kvpair']) && $this->setPair($opts['kvpair']);
      isset($opts['rerankSize']) && $this->addRerankSize($opts['rerankSize']);
    }
  }
932003
public static function constructFrom($values, $opts = null)
    {
        $obj = new static(isset($values['id']) ? $values['id'] : null);
        $obj->refreshFrom($values, $opts);
        return $obj;
    }
76627
public function setOptions($options)
    {
        if ($this->options !== $options) {
            if (!$options instanceof AdapterOptions) {
                $options = new AdapterOptions($options);
            }

            if ($this->options) {
                $this->options->setAdapter(null);
            }
            $options->setAdapter($this);
            $this->options = $options;
        }

        return $this;
    }
772491
public function clearPath($opt = self::PATH | self::QUERY | self::FRAGMENT)
	{
		$path = ($opt & self::PATH) === self::PATH;
		$query = ($opt & self::QUERY) === self::QUERY;
		$fragment = ($opt & self::FRAGMENT) === self::FRAGMENT;
		if ($path) {
			$this->path->clear();
		}
		if ($query) {
			$this->query->clear();
		}
		if ($fragment) {
			$this->fragment->clear();
		}
		return $this;
	}
573345
public function useZooming( array $options = array( 'mode'=>'xy' ) )
    {
        $this->files = array_merge_recursive( array( 'jqplot.cursor.js' ), $this->files );
        $this->setNestedOptVal( $this->options, 'cursor', 'show', true );
        $this->setNestedOptVal( $this->options, 'cursor', 'zoom', true );
    
        return $this;
    }
451725
public function read(array $opts) {

        $scoreRaw = (float) ($opts['grade']->grade ?: 0);
        $scoreMin = (float) ($opts['grade_items']->grademin ?: 0);
        $scoreMax = (float) ($opts['grade_items']->grademax ?: 0);
        $scorePass = (float) ($opts['grade_items']->gradepass ?: null);
        $success = false;
        //if there is no passing score then success is unknown.
        if ($scorePass == null) {
            $success = null;
        }
        elseif ($scoreRaw >= $scorePass) {
            $success = true;
        }
        //Calculate scaled score as the distance from zero towards the max (or min for negative scores).
        $scoreScaled;
        if ($scoreRaw >= 0) {
            $scoreScaled = $scoreRaw / $scoreMax;
        }
        else
        {
            $scoreScaled = $scoreRaw / $scoreMin;
        }

        return [array_merge(parent::read($opts)[0], [
            'recipe' => 'assignment_graded',
            'graded_user_id' => $opts['graded_user']->id,
            'graded_user_url' => $opts['graded_user']->url,
            'graded_user_name' => $opts['graded_user']->fullname,
            'grade_score_raw' => $scoreRaw,
            'grade_score_min' => $scoreMin,
            'grade_score_max' => $scoreMax,
            'grade_score_scaled' => $scoreScaled,
            'grade_success' => $success,
            'grade_completed' => true,
            'grade_comment' => strip_tags($opts['grade_comment']),
        ])];
    }