Hiding values at 0 in a pie chart

Hi there,  As subject I would need to know how to do to hide in a pie chart the values 0

I have a pie chart that take values from a datasource and it is possible that one or many values a

thank you


3 Replies

DG Durga Gopalakrishnan Syncfusion Team August 29, 2024 12:09 PM UTC

Hi Francesco,


Thanks for using Syncfusion products.


Your requirement can be achieved by disabling ShowZero property in data label. We have attached the sample for your reference. Please check with the below screenshot and code snippet.


<SfAccumulationChart>

    <AccumulationChartSeriesCollection>

        <AccumulationChartSeries>

            <AccumulationDataLabelSettings Visible="true" ShowZero="false">

           </AccumulationDataLabelSettings>

        </AccumulationChartSeries>

    </AccumulationChartSeriesCollection>

</SfAccumulationChart>

@code {

 public List<Statistics> StatisticsDetails = new List<Statistics>

    {

        new Statistics { Browser = "Chrome", Users = 37 },

        new Statistics { Browser = "UC Browser", Users = 17 },

        new Statistics { Browser = "iPhone", Users = 0 },

        new Statistics { Browser = "Others", Users = 4  },

        new Statistics { Browser = "Opera", Users = 11 },

        new Statistics { Browser = "Android", Users = 0 },

    };

}



Sample : https://blazorplayground.syncfusion.com/BjhfXFLEpMideYAq


Kindly revert us if you have any concerns.


Regards,

Durga Gopalakrishnan.



FP Francesco Pruneri August 29, 2024 12:58 PM UTC

Great THX It works as well



DG Durga Gopalakrishnan Syncfusion Team August 30, 2024 05:44 AM UTC

Most welcome. Please get back to us if you need any further assistance. We are always happy in assisting you. 


Loader.
Up arrow icon