Hi,
I have a XamChart that shows my experiments' status:
<igCa:XamChart.Series> <igCa:Series ChartType="Pie"> <igCa:Series.DataPoints> <igCa:DataPoint Value="{Binding ActivityStatus.NumWaiting}" Label="Waiting"></igCa:DataPoint> <igCa:DataPoint Value="{Binding ActivityStatus.NumRunning}" Label="Running"></igCa:DataPoint> <igCa:DataPoint Value="{Binding ActivityStatus.NumPassed}" Label="Passed"></igCa:DataPoint> <igCa:DataPoint Value="{Binding ActivityStatus.NumFailed}" Label="Failed"></igCa:DataPoint> <igCa:DataPoint Value="{Binding ActivityStatus.NumOnHold}" Label="Onhold"></igCa:DataPoint> <igCa:DataPoint Value="{Binding ActivityStatus.NumRemoved}" Label="Removed"></igCa:DataPoint> </igCa:Series.DataPoints> </igCa:Series> </igCa:XamChart.Series></igCa:XamChart>
All values come from my data context. I have 2 questions:
1. I'd like to assign my own colors to the labels. For example, I'd like 'Passed' to be green, 'Failed' to be red etc. (the default colors aren't distinct).
2. I'd like the chart to show numbers. For example, if I have 1 pass, 1 fail, 1 running and 7 waiting, I'd like to see those numbers instead of just seeing the relative part in the matching colors.
Thanks in advance.
Hello,
Thank you for your post. I have been looking into it and I can suggest you use our XamPieChart control instead of XamChart’s Pie, because the XamChart is now retired control and we no longer provide fixes and features for it. You can take a look at the Samples Browser under xamPieChart / Display section, where the functionality you want is achieved.
Hope this helps you.
Hi again,
I handled the colors issue.
I see that the XamPieChart is a part of Infragistics 2012 package. I can't have it currently, can we find some workaround to present values near or inside the XamChart?
Thanks,
Noa
Hello Noa,
I have been looking into your question and I can say that you are not able to move the values out of the PieChart. Also I can say that the XamPieChart is available from vesrion 11.2.
There's a solution to both my problems using 11.1 version:
<igCa:DataPoint Value="{Binding ActivityStatus.NumWaiting}" Label="{Binding WaitingLabel}" Fill="Yellow"/>
The binding is a bit more complex this way:
private string waitingLabel; public string WaitingLabel { get { return ActivityStatus == null ? "Waiting" : waitingLabel; } set { SetAndNotify(ref waitingLabel, value, () => WaitingLabel);} }
(SetAndNotify() checks if the value has changed, if so updates it and fires the PropertyChanged event, ActivityStatus holds my relevant ever-updating numbers).
I find it disappointing that you offered me to upgrade without mentioning at least the 'Fill' property.
Hello Noah,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.