JavaScript
var dataStatCounter = [
{
Month: 'January',
Share: 30
},
{
Month: 'February',
Share: 30
},
{
Month: 'March',
Share: 30
},
{
Month: 'April',
Share: 30
},
{
Month: 'May',
Share: 30
},
{
Month: 'June',
Share: 30
},
{
Month: 'July',
Share: 30
},
{
Month: 'August',
Share: 30
},
{
Month: 'September',
Share: 30
},
{
Month: 'October',
Share: 30
},
{
Month: 'November',
Share: 30
},
{
Month: 'December',
Share: 30
}
];
var sampleData = [
{
Name: 'Bar 1',
Data: 3000,
},
{
Name: 'bar 2',
Data: 2000,
},
{
Name: 'Bar 3',
Data: 2500,
},
];
var settings = {
title: "Months",
description: "",
enableAnimations: true,
showLegend: false,
source: dataStatCounter,
colorScheme: 'scheme02',
seriesGroups: [{
type: 'pie',
showLabels: true,
click: clickFunc,
series: [{
dataField: 'Share',
displayText: 'Month',
labelRadius: 120,
initialAngle: 80,
radius: 150,
centerOffset: 0,
formatFunction: function(value, itemIndex) {
return dataStatCounter[itemIndex].Month;
},
formatSettings: {
sufix: '%',
decimalPlaces: 1
},
toolTipFormatFunction: function(value, itemIndex) {
var label = dataStatCounter[itemIndex].Month + ': ' + dataStatCounter[itemIndex].Share + '%';
return label;
}
}]
}]
};
var settings2 = {
title: "Sample bar chart",
description: "",
showLegend: false,
enableAnimations: true,
source: sampleData,
xAxis: {
dataField: 'Name',
gridLines: {
visible: true
},
},
valueAxis: {
flip: true,
labels: {
visible: true,
}
},
colorScheme: 'scheme01',
seriesGroups: [{
type: 'column',
orientation: 'horizontal',
columnsGapPercent: 50,
toolTipFormatSettings: {
thousandsSeparator: ','
},
series: [{
...