You are here

function flot_fields_views_plugin_style::option_definition in Flot 7

Information about options for all kinds of purposes will be held here.

@code 'option_name' => array(

  • 'default' => default value,
  • 'translatable' => (optional) TRUE/FALSE (wrap in t() on export if true),
  • 'contains' => (optional) array of items this contains, with its own defaults, etc. If contains is set, the default will be ignored and assumed to be array().
  • 'bool' => (optional) TRUE/FALSE Is the value a boolean value. This will change the export format to TRUE/FALSE instead of 1/0.
  • 'export' => (optional) FALSE or a callback for special export handling if necessary.
  • 'unpack_translatable' => (optional) callback for special handling for translating data within the option, if necessary.

),

Return value

array Returns the options of this handler/plugin.

Overrides views_plugin_style::option_definition

See also

views_object::export_option()

views_object::export_option_always()

views_object::unpack_translatable()

File

flot_views/views/flot_fields_views_plugin_style.inc, line 11
Style plugin for views

Class

flot_fields_views_plugin_style
@file Style plugin for views

Code

function option_definition() {
  $options = parent::option_definition();
  $options['size'] = array(
    'default' => '400x200',
  );
  $options['showlegend'] = array(
    'default' => 'yes',
  );
  $options['zoomable'] = array(
    'default' => 1,
  );
  $options['hoverable'] = array(
    'default' => 1,
  );
  $options['shadowSize'] = array(
    'default' => '',
  );
  $options['legend'] = array(
    'default' => array(
      'noColumns' => 1,
      // number of colums in legend table
      'labelBoxBorderColor' => "#ccc",
      // border color for the little label boxes
      'position' => "bottom",
      // position of default legend container within plot
      'margin' => array(
        // distance from grid edge to default legend container within plot
        'x' => 5,
        'y' => 5,
      ),
      'backgroundColor' => "",
      // empty means auto-detect
      'backgroundOpacity' => 0.85,
    ),
  );
  $options['showxaxis'] = array(
    'default' => 1,
  );
  $options['showyaxis'] = array(
    'default' => 1,
  );
  $options['xaxis'] = array(
    'default' => array(
      'position' => "bottom",
      // or "top"
      'color' => "",
      // base color, labels, ticks
      'tickColor' => "",
      // possibly different color of ticks, e.g. "rgba(0,0,0,0.15)"
      'min' => "",
      // min. value to show, "" means set automatically
      'max' => "",
      // max. value to show, "" means set automatically
      'autoscaleMargin' => "",
      // margin in % to add if auto-setting min/max
      'granularity' => "auto",
      'labelWidth' => "",
      // size of tick labels in pixels
      'labelHeight' => "",
    ),
  );
  $options['yaxis'] = array(
    'default' => array(
      'label' => 'default',
      'position' => "left",
      // or "right"
      'color' => "",
      // base color, labels, ticks
      'tickColor' => "",
      // possibly different color of ticks, e.g. "rgba(0,0,0,0.15)"
      'min' => "",
      // min. value to show, "" means set automatically
      'max' => "",
      // max. value to show, "" means set automatically
      'autoscaleMargin' => 0.02,
      // margin in % to add if auto-setting min/max
      'granularity' => "auto",
      'labelWidth' => "",
      // size of tick labels in pixels
      'labelHeight' => "",
    ),
  );
  return $options;
}