The MindFusion Forums
Gauge and Chart Components >> Html Canvas & JavaScript >> Show outer labels in a pie chart?
https://mindfusion.eu/Forum/YaBB.pl?num=1473845508

Message started by Dennis on Sep 14th, 2016 at 9:31am

Title: Show outer labels in a pie chart?
Post by Dennis on Sep 14th, 2016 at 9:31am
Hi there,

I'm trying to create a pie chart with the JS library and I am having a problem how to show the outer labels.

I set them in the construcotr:

var series = new PieSeries(myValues, null, new Collections.List(["t1", "t2", "t3", "t4", "t5"]));

I have no errors, the pie shows but no labels. Is this a bug?

Title: Re: Show outer labels in a pie chart?
Post by Slavcho on Sep 14th, 2016 at 2:25pm
Hi,

The pie chart draws only inner labels by default. You can specify you want to show all label kinds supported by the series like this -

[code]
pieChart.showDataLabels = Charting.LabelKinds.All;[/code]

LabelKinds allows bitwise combination where you could enable / disable individual flags to show specific labels -

http://www.mindfusion.eu/onlinehelp/chart.javascript/index.htm?T_MindFusion_Charting_LabelKinds_0.htm

Regards,
Slavcho
Mindfusion

Title: Re: Show outer labels in a pie chart?
Post by Dennis on Sep 14th, 2016 at 7:11pm
Hi,

The labels show now, thanks. Is there a way to increase the font size?

Title: Re: Show outer labels in a pie chart?
Post by Slavcho on Sep 15th, 2016 at 8:57am
Hi,

There are various fontSize properties provided by the Theme class. For data labels set this -

[code]
pieChart.theme.dataLabelsFontSize = 12;[/code]

Here's a list of other Theme properties you could set for the chart -
http://www.mindfusion.eu/onlinehelp/chart.javascript/index.htm?T_MindFusion_Charting_Theme_Members_0.htm

Regards,
Slavcho
Mindfusion

The MindFusion Forums » Powered by YaBB 2.6.11!
YaBB Forum Software © 2000-2024. All Rights Reserved.