Pie Chart

Short Description

This module features a simple pie chart diagram. It uses some animations and provides some customization options.

Example Code

<div id="table-sparql-query" class="plastic-js" style="height: 300px; width: 100%;">

    <script class="plastic-data" type="application/json" data-url="/docs/_static/data/countries.json" data-format="sparql-json"></script>

    <script class="plastic-display" data-module="pie-chart" type="application/json">
        {
            "showLabels": false,
            "tooltips": true
        }
    </script>

</div>

Live Example

Example Data

Link to the JSON file - click here.

Dependencies

Note

plastic.js manages the dependencies automatically. There is no need to include them manually, but you can do so if you want.

Available Options

This example snippet contains all available options with their default values:

<script class="plastic-display" data-module="pie-chart" type="application/json>
    {
        "showLabels": true
        "tooltips": true
        "transitionDuration": 350
    }
</script>

Properties details:

Display Labels

DescriptionShow the labels.
KeywordshowLabels
Typeboolean
Defaulttrue
"showLabels": true

Tooltips

DescriptionShow tooltips
Keywordtooltips
Typeboolean
Defaulttrue
"tooltips": true

Transition Duration

DescriptionDuration of the animation in milliseconds.
KeywordtransitionDuration
Typenumber
Default350
"transitionDuration": 350