Commit ba93aa4c authored by Daniel Cothran's avatar Daniel Cothran
Browse files

Issue #3277589 by nikathone, andileco: Clean up code documentation, add return types, etc.

parent 3e47f430
Loading
Loading
Loading
Loading
+5 −5
Changes for README.md: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -179,11 +179,11 @@ y-axis. You still need to configure the "Settings" in the "Format" section.
## Creating Charts in the UI with a Chart Field

If you want a chart in your entity (e.g. "node"), but don't need its data to be
dynamic (like Views could generate), you can use a Chart field. Add this field to
your bundle (e.g. "content type") via the "Manage Fields" tab - like you would
any other field. When you add a new entity, you can select the charting library,
chart type, and other configurations. You can add data using a CSV or by
manually adding it into the table input. The chart will show on your entity
dynamic (like Views could generate), you can use a Chart field. Add this field
to your bundle (e.g. "content type") via the "Manage Fields" tab - like you
would any other field. When you add a new entity, you can select the charting
library, chart type, and other configurations. You can add data using a CSV or
by manually adding it into the table input. The chart will show on your entity
after saving.

## Creating Charts in the UI with a Chart Block
+4 −3
Changes for modules/charts_api_example/src/Controller/ChartsApiExample.php: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -123,7 +123,8 @@ class ChartsApiExample extends ControllerBase {
        '#type' => 'chart',
        '#tooltips' => $charts_settings->get('charts_default_settings.display.tooltips'),
        '#title' => $this->t('@library @type Chart', [
          '@library' => ucfirst($library), '@type' => ucfirst($type)
          '@library' => ucfirst($library),
          '@type' => ucfirst($type),
        ]),
        '#chart_type' => $type,
        'series' => $series,
@@ -196,7 +197,7 @@ class ChartsApiExample extends ControllerBase {
          'scales' => [
            'x' => [
              'ticks' => [
                'autoSkip' => TRUE
                'autoSkip' => TRUE,
              ],
            ],
          ],
@@ -375,7 +376,7 @@ class ChartsApiExample extends ControllerBase {
  /**
   * Returns the CSV contents in an array with data organized by column.
   *
   * @return array $all_rows
   * @return array
   *   The array of rows.
   */
  private function getCsvContents() {
+2 −1
Changes for modules/charts_billboard/src/Plugin/chart/Library/Billboard.php: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -226,7 +226,8 @@ class Billboard extends ChartBase implements ContainerFactoryPluginInterface {
    // Merge in chart raw options.
    if (!empty($element['#raw_options'])) {
      $chart_definition = NestedArray::mergeDeepArray([
        $element['#raw_options'], $chart_definition
        $element['#raw_options'],
        $chart_definition,
      ]);
    }

+6 −2
Changes for modules/charts_blocks/README.md: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
#Charts Blocks

Use this module if you would like a chart added via Layout Builder or the "Block layout" page. You will need to enable at least one charting provider submodule before this module can be used. Data can be added manually or by uploading a CSV file.
Use this module if you would like a chart added via Layout Builder or the
"Block layout" page. You will need to enable at least one charting provider
submodule before this module can be used. Data can be added manually or by
uploading a CSV file.

If you create your chart using a View, you do not need this module - just add a "Block" display to your View.
If you create your chart using a View, you do not need this module - just add
a "Block" display to your View.
+3 −3
Changes for modules/charts_c3/README.md: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -4,9 +4,9 @@ If you use Composer to manage dependencies, edit your site's "composer.json"
file as follows.

1. Run `composer require --prefer-dist composer/installers` to ensure that
   you have the "composer/installers" package installed. This package facilitates
   the installation of packages into directories other than "/vendor" (e.g.
   "/libraries") using Composer.
you have the "composer/installers" package installed. This package
facilitates the installation of packages into directories other than
"/vendor" (e.g. "/libraries") using Composer.

2. Add the following to the "installer-paths" section of "composer.json":

Loading