2

Labels on the pie chart are fine to me. Labels outside of the pie chart are not, I would like to make these disappear since on Iphone or a screen that size, labels pop out of the pie chart and are out of the screen most of the time.

I did not find anything in Sencha Architect that allowed me to overide this mechanism for labels. Would someone have an idea?

enter image description here

Fawar
  • 735
  • 2
  • 11
  • 32

1 Answers1

0

You have to extend Ext.chart.series.sprite.PieSlice and override the method sliceContainsLabel:

Ext.define('yourNamespase.CustomPieSlice', {
    alias: 'sprite.custompieslice',
    extend: 'Ext.chart.series.sprite.PieSlice',

    inheritableStatics: {
        def: {
            defaults: {
                doCallout: false,
                rotateLabels: false,
                label: '',
                labelOverflowPadding: 10,
                renderer: null
            }
        }
    },

    sliceContainsLabel: function () {
        return 1;
    }
});

And so the labels will be always inside the pie chart.

Darin Kolev
  • 3,401
  • 13
  • 31
  • 46