Charts Block

Overview

The Charts Block utilises the chart.js library to offer users the ability to create a variety of Charts within the block editor.

Githubhttps://github.com/bigbite/block-charts
Notionhttps://www.notion.so/bigbite/Charts-Block-493f064ab9a14fe89d1a3f7b6c4e7bcf
Product OwnerJonny Waters
Min. Version5.8> (Not tested in prior versions)

Features

  • Offers multiple chart types
    • Pie/Doughnut chart
    • Line chart (horizontal and vertical)
    • Bar chart (horizontal and vertical)
  • Enter multiple datasets (e.g. each line in a line chart is a dataset)
  • Simple data entry via text area or CSV upload
  • Instant previews when data is changed
  • Validation on uploaded files (no. of data items and numeric checks)

Entering Chart Data

NOTE: The amount of labels should always match the amount of data items in each dataset.

Data Format

Entering via input fields

Chart labels should be entered into the Chart labels input field as a comma-separated list:

label 1, label 2, label 3, label 4

Entering via CSV upload

CSV files should be in the following format:

Label 1, Label 2, Label 3,
Label 4
Dataset 1 Label, 10, 30, 20, 70
Dataset 2 Label, 30, 40, 90, 30

Where the first row is the labels for the data (if the first row is not labels, ensure the “First row is labels” checkbox is unchecked at the point of upload.

All subsequent rows will be the separate datasets (separated by line breaks).

the first item of a dataset should always be the dataset label.

Options

Data

  • Chart Title
  • Select a chart type
  • Chart labels: A comma separated list of the labels (items of data) within the chart
  • Dataset:

CSV Upload

  • Select CSV File
  • First row is labels

Styling

  • Set colors for each label in the chart
  • Set a border color for each label in the chart

How to

The block is installed via a Plugin which you can include using Composer. To do so, ensure the following is included in your composer.json file:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "git@github.com:bigbite/block-charts.git"
    }
  ],
  "require": {
    "bigbite/block-charts": {{RELEASE_NO}}
  },
  "extra": {
    "installer-paths": {
      "plugins/{$name}/": [
        "type:wordpress-plugin"
      ]
    }
  }
}

To report a Bug:

  1. Visit https://github.com/bigbite/block-charts/issues
  2. Add a screenshot/video of the issue you are experiencing
  3. Add a description of the issue you are experiencing
  4. Add the label bug

To suggest a feature, either:

  1. Contact the Product Owner

OR

  1. Visit https://github.com/bigbite/block-charts/issues
  2. Create a new Issue
  3. Write your suggestion in as much as detail as possible – preferably detailing the problem you are trying to solve.
  4. Add the label enhancement

Technical Details

There are currently no hooks or filters provided by this block.