We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

PieSeries: XBinding inside the DataMarkers?

Thread ID:

Created:

Updated:

Platform:

Replies:

123986 May 5,2016 12:03 PM May 10,2016 05:54 AM Xamarin.Forms 6
loading
Tags: SfChart
Paco Gómez
Asked On May 5, 2016 12:03 PM

Hello,
would it be possible to place, in a PieSeries, the XBinding value together with the Percentage value?

Thanks.,

Paco Gómez
Replied On May 6, 2016 07:03 AM

Anybody can help me?

Gobi M [Syncfusion]
Replied On May 6, 2016 08:07 AM

Hi Francisco, 
 
Thanks for contacting Syncfusion support. 
 
We are able to achieve your requirement PieSeries: XBinding inside the datamarkers. We have created sample for this and it is available for download in below location. 
 
 
Please let us know if you need any further assistance. 
 
Regards, 
Gobi M 


Paco Gómez
Replied On May 6, 2016 08:57 AM

Hello,

I have compiled the solution and it works fine. Just put the same code than the example but still not works..



Here is my code:

      <chart:SfChart VerticalOptions="FillAndExpand">
        <chart:SfChart.PrimaryAxis>
          <chart:CategoryAxis/>
        </chart:SfChart.PrimaryAxis>

        <chart:SfChart.Legend>
          <chart:ChartLegend/>
        </chart:SfChart.Legend>

        <chart:SfChart.SecondaryAxis>
          <chart:NumericalAxis/>
        </chart:SfChart.SecondaryAxis>

        <chart:SfChart.Series>
          <chart:PieSeries ItemsSource="{Binding TopSalesPersonKpiAmountSoldRows}" XBindingPath="SalesPersonName" YBindingPath="AmountSold" CircularCoefficient="0.6" ConnectorLineType="Line" DataMarkerPosition="OutsideExtended">
            <chart:PieSeries.DataMarker>
              <chart:ChartDataMarker LabelContent="Percentage"/>
            </chart:PieSeries.DataMarker>
          </chart:PieSeries>
        </chart:SfChart.Series>
      </chart:SfChart>

Gobi M [Syncfusion]
Replied On May 9, 2016 01:26 AM

Hi Francisco, 
 
We have achieved your requirement using Custom Renderers. So, Could you please add code from iOS and Android projects too to add XBinding values in datamarkers? 
 
Custom renderers for iOS implemented in AppDelegate.cs file and for android platform refer to the MainActivity.cs, CustomRenderer.cs files. 
 
Please let us know for any concerns. 
 
Regards, 
Gobi M 


Paco Gómez
Replied On May 9, 2016 05:03 AM

Well, previous message you show me how to do this without any renderers and it works, but not in my code.

My question is: how can I do this avoiding extra code? because you got it in your isolated example.

By the way, I am looking the approach you sent me and I don't like it too much:

- In iOS, we are messing the AppDelegate instead of use a CustomRenderer.
- In Android, your solution applies to all the charts, not to only the PieSeries charts, and I don't understand why you have to create a new instance of the renderer in the MainActivity. I have a lot of Renderers and anyone needs to be manually instantiated.

Thanks.

Gobi M [Syncfusion]
Replied On May 10, 2016 05:54 AM

Hi Francisco, 
 
XBinding inside the DataMarkers can be achieved only by the use of Custom Renderers. So, we have to add Custom Renderer code in iOS and Android projects. We have also implemented the same in a sample that we have attached in our previous update. 
 
In Android, if you are using latest Xamarin Forms version then you no need to instantiate the CustomRenderer class. We have modified the sample that works only for pie series also added the mentioned changes. It can be downloaded from the below location. 
 
 
Please let us know for any concerns. 
 
Regards, 
Gobi M 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;