Line Chart¶
Short Description¶
The Line Chart displays one or multiple data series as a line in a grid. An interactive guideline helps to read the exact value.
Example Code¶
<div class="plastic-js" style="height: 400px">
<script class="plastic-data" type="application/json" data-url="/docs/_static/data/countriesComparison.json" data-format="sparql-json"></script>
<script class="plastic-display" data-module="line-chart" type="application/json">
{
"useInteractiveGuideline": 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.
D3.js¶
- Website: http://d3js.org/
- Version: 3.4.6
- JavaScript: http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.6/d3.min.js
NVD3¶
- Website: http://nvd3.org/
- Version: 1.1.15-beta
- JavaScript: http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js
- CSS: http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css
Available Options¶
This example snippet contains all available options with their default values:
<script class="plastic-display" data-module="line-chart" type="application/json>
{
"useInteractiveGuideline": true
"transitionDuration": 350
"showLegend": true
"marginLeft": true
}
</script>
Properties details:
Interactive Guideline
Description | Show the interactive Guideline. |
Keyword | useInteractiveGuideline |
Type | boolean |
Default | true |
"useInteractiveGuideline": true
Transition Duration
Description | Duration of the animation in milliseconds. |
Keyword | transitionDuration |
Type | number |
Default | 350 |
"transitionDuration": 350
Display Legend
Description | Show the legend, allowing users to turn on/off line series. |
Keyword | showLegend |
Type | boolean |
Default | true |
"showLegend": true
Left Margin
Description | Adjust chart margins to give the x-axis some breathing room. |
Keyword | marginLeft |
Type | boolean |
Default | true |
"marginLeft": true