You are here

ChartInterface.php in Charts 5.0.x

Same filename and directory in other branches
  1. 8.4 src/Plugin/chart/Library/ChartInterface.php

File

src/Plugin/chart/Library/ChartInterface.php
View source
<?php

namespace Drupal\charts\Plugin\chart\Library;

use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Core\Plugin\PluginFormInterface;

/**
 * Defines an interface for Chart plugins.
 */
interface ChartInterface extends PluginInspectionInterface, PluginFormInterface, ConfigurableInterface {

  /**
   * Used to define a single axis.
   *
   * Constant used in chartsTypeInfo() to declare chart types with a
   * single axis. For example a pie chart only has a single dimension.
   */
  const SINGLE_AXIS = 'y_only';

  /**
   * Used to define a dual axis.
   *
   * Constant used in chartsTypeInfo() to declare chart types with a dual
   * axes. Most charts use this type of data, meaning multiple categories each
   * have multiple values. This type of data is usually represented as a table.
   */
  const DUAL_AXIS = 'xy';

  /**
   * Pre render.
   *
   * @param array $element
   *   The element.
   *
   * @return array
   *   The chart element.
   */
  public function preRender(array $element);

  /**
   * Return the name of the chart.
   *
   * @return string
   *   Returns the name as a string.
   */
  public function getChartName();

}

Interfaces

Namesort descending Description
ChartInterface Defines an interface for Chart plugins.