Hi,
There are two questions about customization of IGPieChartView. Thanks in advance.
1. I want to show NO label in my chart, but labels in legend. I can switch labels on/off by setting _infraPieChart.labelsPosition = IGLabelsPositionNone, however, this property will impact labels in chart and legend at same time. Is it possible to just make label visible in Legend ?
2. I want to show Labels in legend in some certain format, like 'LabelName : Value'. Found that there is a method called 'labelWithItem' under IGPieChartViewDelegate, but seems it never gets hit. The other two 'taoWithItem' and 'viewForTooltipWithItem' are working properly. How can I customize labels in legend ?
Regards,
Allen.
Cycle through the .dataPoints collection off the chart and find the object
public override void ItemTapped (IGPieChartView pieChartView, IGPieSliceInfo item, System.Drawing.PointF point) { IGCategoryPoint dataPoint = (IGCategoryPoint)item.Item; for (int i = 0; i < pieChartView.DataPoints.Count; i++) { IGCategoryPoint tempObject = pieChartView.DataPoints.GetItem<IGCategoryPoint>(i); if (dataPoint == tempObject) { // now i is your index; int xx = 0; xx++; } } }
My pie chart always contains to slides on is ontime and another one is latetime. When ever user click on ontime slice then i want to get that slice index value. Based on that index value i want show data. How can i get the slice index value when ever user tapped on slice. I want code snippet in C#.net
public override void ItemTapped(IGPieChartView pieChartView, IGPieSliceInfo item, System.Drawing.PointF point) {
}
using this method possible to get slice index.
That would translate to the GetPointAt method off the datasource helper.
It would look something like this:
public override IGDataPoint GetPointAt (IGPieChartView pieChartView, int index) { double myValue = ((NSNumber)_data [index]).DoubleValue; NSString newString = "someNewString"; return new IGCategoryPoint (myValue, newString); }
I want this one in c#
-(IGDataPoint *)pieChartView:(IGPieChartView *)pieChartView pointAtIndex:(int)index{ double value = [(NSNumber*)_data[index] doubleValue]; //any text set here will be displayed in the slices and the legend. NSString *label = [NSString stringWithFormat:@"Item %d", index]; return [[IGCategoryPoint alloc]initWithValue:value andLabel:label];}
How can i get IGPieSliceInfo index value in Xamarin c#.
For example I have a pie chart with two slice. One is Ontime and Lateness. I didn't show label on the IGpiechartview. So how can i get the particular slice is click. I am using following code. in this override method i want to get information about clicked slice.
If user click on OnTime slice then i want to get that OnTime slice information. In the following code i am getting value and label but i didn't show the label on slice. There is a way to Hidden the label value on slice.
Thanks,
seshu P.