2011-12-14 3 views
2

내 PieChart에 맞춤 라벨을 만들고 싶습니다. 현재 내 레이블 유형은 PieLabelType.Value이지만 통화 기호 (€)와 1000 단위 구분 기호를 표시하려면 값을 형식화해야합니다.ZedGraph PieChart의 맞춤 라벨

일반적으로 C0과 함께 String.Format 메서드를 인자로 사용하지만, PieLabelType.Value.Format("C0")을 사용할 수 없습니다.

코드 샘플 :

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; 

가 어떻게이 문제를 해결할 수 있습니까?

답변

2

문제점에 대한 해결책을 찾았습니다.

나는 Enum PieLabelType에 항목을 추가하기 위해 ZedGraph 라이브러리의 PieItem 클래스를 편집했습니다.

Enum 값에 따라 반환 문자열의 형식을 지정하는 코드를 수정했습니다.