Constructor
new PearlChart(options)
- Source:
Examples
browser usage:
const PearlChartExample = new OECDCharts.PearlChart({
container: '#PearlChartExample',
extent: [300, 600],
title: 'Pearl Chart',
renderInfoButton: true,
showTicks: true,
showLabels: false,
colorLabels: true,
callback: data => console.log(data),
data: [
{
value: 410,
color: '#900c3f',
showLabel: true, // default is false
labelPlacement: 'bottom' // default 'top'
},
{
value: 520,
color: '#189aa8',
showLabel: false, // default is false
labelPlacement: 'top'
}
],
labelFormat: val => `${Math.round(val)} $`
});
ES6 modules usage:
import { PearlChart } from 'oecd-simple-charts';
import 'oecd-simple-charts/build/oecd-simple-charts.css'
const pearlChart = new PearlChart({ chartOptions });
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | The options object for the pearl chart. Properties
|
Methods
update(data)
- Source:
Example
PearlChartExample.update([
{
value: 490,
color: '#900c3f'
},
{
value: 820,
color: '#189aa8'
}
]);
Parameters:
Name | Type | Description |
---|---|---|
data |
array | an array containing objects with the new data |