2

I want to create custom labels on my PieChart. Currently, the type of my labels is PieLabelType.Value but I need to format the value to display a currency symbol (€) and the thousands separator.

Usually, I use the String.Format method with C0 as an argument, but I can't use PieLabelType.Value.Format("C0").

Code sample:

PieItem oTempPie1 = oGraphPane.AddPieSlice(oGerCosts._CNQ_, RedColor, 0, "blabla");
oTempPie1.LabelType = PieLabelType.Value;
PieItem oTempPie2 = oGraphPane.AddPieSlice(oGerCosts._CTQ_, BlueColor, 0, "blabla");
oTempPie2.LabelType = PieLabelType.Value;

oGraphPane.Title.Text = "RDV " + sScenarioReference;
oGraphPane.Legend.Position = LegendPos.Right;
oGraphPane.Legend.IsVisible = true;

// Font:
oGraphPane.Title.FontSpec.Size = c_fDefaultFontSize;
oGraphPane.Title.FontSpec.IsBold = true;
oGraphPane.Legend.FontSpec.Size = c_fDefaultFontSize;

How can I solve this problem?

Dennis
  • 14,264
  • 2
  • 48
  • 57
Artaher
  • 41
  • 4

1 Answers1

2

I found a solution for my problem.

I've edited the PieItem class of ZedGraph library to add item on the Enum PieLabelType.

I've modified the code to format the return string according to the Enum value.

Artaher
  • 41
  • 4