mykola-digtiar / chartjs-plugin-piechart-outlabels

Highly customizable Chart.js plugin that displays labels outside the pie/doughnut chart.
https://piechart-outlabels.netlify.com/sample/
MIT License
51 stars 38 forks source link

Use this plugin with angular-chart.js #1

Open imsamdez opened 6 years ago

imsamdez commented 6 years ago

Hi,

I'm discovering angular and I'll be interesting in using your plugin with angular-chart.js.

Is there any ways to do this ? I'm a bit lost even after looking at some other plugin integrations.

Help is much appreciate !

mykola-digtiar commented 6 years ago

Hi, of course it is possible to use the plugin with angular-chart.js I will provide more information about it in 2-3 days.

RichardFans commented 6 years ago

javascript:

vm.options =  {
                    tooltips: {
                        enabled: false
                    },
                    zoomOutPercentage: 68,
                    plugins: {
                        outlabels: {
                            stretch: 18,
                            lineWidth: 1,
                            font: {
                                resizable: false,
                                size: 10
                            }
                        }

                    }
                };

html:

<canvas id="wholeChartPie" class="chart-base"
                    chart-options="vm.options"
                    chart-type="'outlabeledPie'"
                    chart-data="vm.chartData" chart-labels="vm.chartLabels" chart-series="vm.chartSeries">
</canvas>
jdlopezq commented 6 years ago

Hi I'm tryin to get this work in angular 5, when i put this 'outlabeledPie' in chart-type, i get this error: Error: "outlabeledPie'" is not a chart type. And if i put it in the ts file the charts are render but only in gray scale, and whe i use the chart-type "pie" the labels always are out of the container, maybe you can help me pls :)

Cristianopavan commented 6 years ago

by any chance is that work with chart-funnel -js plugin thanks in advance

Ahsan9981 commented 2 years ago

Is there any plugin for polar chart in chart.js for Angular ? Currently I am using datalabels plugin for this and this does not have anything to make the labels to stay outside polar chart rings and they move with the amount of data section displayed. image_2022_02_03T07_21_58_077Z I want these datalabels outside of these rings at fixed positions. Here is my code.

plugins: {
      datalabels: {
         color: '#000000',
         anchor: 'end',
         align: 'end',
         padding: 150,
         display: true,
         font: {
           weight: 'bolder'
         },
         formatter: function(value, ctx) {
          return `${ctx.chart.data.labels[ctx.dataIndex]} - ${value} %`;
       },
      },
    },