Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.pieChartColors = [
- {
- backgroundColor: [
- this.configFn.rgba(this.config.colors.success, 0.7),
- this.configFn.rgba(this.config.colors.warning, 0.7),
- this.configFn.rgba(this.config.colors.danger, 0.7)
- ],
- hoverBackgroundColor: [
- this.config.colors.success,
- this.config.colors.warning,
- this.config.colors.danger
- ],
- borderColor: this.config.colors.grayLight,
- borderWidth: 1,
- hoverBorderWidth: 3
- }
- ];
- this.pieChartOptions = {
- title: {
- display: true,
- text: 'Corporate Info With %',
- fontColor: this.config.colors.gray,
- fontSize: 14,
- fontStyle: 'normal'
- },
- legend: {
- labels: {
- fontColor: this.configFn.rgba(this.config.colors.gray, 0.9),
- }
- },
- tooltips:{
- enabled:true,
- backgroundColor: this.configFn.rgba(this.config.colors.main, 0.7),
- callbacks:{
- label: function(tooltipItem, data) {
- var dataset = data.datasets[tooltipItem.datasetIndex];
- var total = dataset.data.reduce(function(previousValue, currentValue, currentIndex, array) {
- return previousValue + currentValue;
- });
- var currentValue = dataset.data[tooltipItem.index];
- var precentage = Math.floor(((currentValue/total) * 100)+0.5);
- return data.labels[tooltipItem.index] + ': ' + precentage + '%';
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement