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. Image for the cookie policy date

PieSeries: XBinding inside the DataMarkers?

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

Thanks.,

6 Replies

PG Paco Gómez May 6, 2016 11:03 AM UTC

Anybody can help me?


GM Gobi M Syncfusion Team May 6, 2016 12:07 PM UTC

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 



PG Paco Gómez May 6, 2016 12:57 PM UTC

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>


GM Gobi M Syncfusion Team May 9, 2016 05:26 AM UTC

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 



PG Paco Gómez May 9, 2016 09:03 AM UTC

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.


GM Gobi M Syncfusion Team May 10, 2016 09:54 AM UTC

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 


Loader.
Up arrow icon