Pie chart with line header

4 posts, 0 answers
  1. Megharaj
    Megharaj avatar
    28 posts
    Member since:
    May 2015

    Posted 04 Jan Link to this post

    Dear Telerik Team,

     

    Please find the image in the attachment, below are the two requests from our end

    1. can i show the Pie slice % value and slice name outside pie chart with a line indication similar to image using IOS(swift)

    2. is it possible to show the 3D effect on the pie chart similar to image?

     

    Thanks

  2. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 04 Jan Link to this post

    Hi Megharaj,

    Directly to your questions:

    1. You can add point labels in pie chart by setting the pointLabelStyle textHidden and textColor properties:
    series.style.pointLabelStyle.textHidden = NO;
    series.style.pointLabelStyle.textColor = [UIColor redColor];

    After that you can customize the point label text by handling chart:labelForDataPoint:property:inSeries:atIndex: method of TKChartDelegate:
    - (TKChartPointLabel *)chart:(TKChart *)chart labelForDataPoint:(id<TKChartData>)dataPoint property:(NSString *)propertyName inSeries:(TKChartSeries *)series atIndex:(NSUInteger)dataIndex
    {
        TKChartPointLabel *label = [[TKChartPointLabel alloc] initWithPoint:dataPoint series:series text:@"my label text"];
        return label;
    }

    Finally set the labelDisplayMode property to TKChartPieSeriesLabelDisplayModeOutside to place point labels outside of the chart:
    series.labelDisplayMode = TKChartPieSeriesLabelDisplayModeOutside;

    Currently TKChart does not support point labels with lines and this should be implemented with code. This feature seems reasonable and I logged it in our feedback portal. Use this link to track its status.

    2. Currently TKChart does not support 3d effects. I logged this too in our feedback portal. Here is the link.

    I hope this helps. I updated your Telerik points accordingly.

    Regards,
    Jack
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Enrique
    Enrique avatar
    4 posts
    Member since:
    Apr 2016

    Posted 11 Apr in reply to Jack Link to this post

    How can I set this properties in C# for same Telerik Xamarin IOS Donut Chart? I mean what method should be handled tho show custom label.
  5. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 14 Apr Link to this post


    Hi Enrique,

    Normally, properties exposed by the Xamarin Wrapper are with the same names. You can take a look at the Customization article in the online docs regarding point label customization in C#:

    http://docs.telerik.com/devtools/ios/Chart/PointLabels/customization

    Hope this helps.

    Regards,
    Deyan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner