You are here

public function ChartsPluginStyleChart::getChildrenChartDisplays in Charts 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/views/style/ChartsPluginStyleChart.php \Drupal\charts\Plugin\views\style\ChartsPluginStyleChart::getChildrenChartDisplays()
  2. 8 src/Plugin/views/style/ChartsPluginStyleChart.php \Drupal\charts\Plugin\views\style\ChartsPluginStyleChart::getChildrenChartDisplays()
  3. 5.0.x src/Plugin/views/style/ChartsPluginStyleChart.php \Drupal\charts\Plugin\views\style\ChartsPluginStyleChart::getChildrenChartDisplays()

Utility function to check if this chart has children displays.

Return value

array Children Chart Display.

1 call to ChartsPluginStyleChart::getChildrenChartDisplays()
ChartsPluginStyleChart::render in src/Plugin/views/style/ChartsPluginStyleChart.php
Render the display in this style.

File

src/Plugin/views/style/ChartsPluginStyleChart.php, line 443

Class

ChartsPluginStyleChart
Style plugin to render view as a chart.

Namespace

Drupal\charts\Plugin\views\style

Code

public function getChildrenChartDisplays() {
  $children_displays = $this->displayHandler
    ->getAttachedDisplays();
  foreach ($children_displays as $key => $child) {
    $display_handler = $this->view->displayHandlers
      ->get($child);

    // Unset disabled & non chart attachments.
    if (!$display_handler
      ->isEnabled() || strstr($child, 'chart_extension') == !TRUE) {
      unset($children_displays[$key]);
    }
  }
  $children_displays = array_values($children_displays);
  return $children_displays;
}