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

SfCharts not rendering

Hey,
I'm trying to get a chart to render in my xamarin pcl app but I can;t seem to get it to work.
I've installed SfChart.Xforms via nuget package and my xaml page looks like this:
xmlns:chart="clr-namespace:Syncfusion.SfChart.XForms;assembly=Syncfusion.SfChart.XForms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="CrossPlatformApp.ChartPage">
however when i try to run the application it just returns a completely blank page. What can i do to try and get a chart to render?

4 Replies

JM Jacob Miller April 27, 2016 03:20 AM UTC

Sorry I didn't paste the code in properly
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
xmlns:chart="clr-namespace:Syncfusion.SfChart.XForms;assembly=Syncfusion.SfChart.XForms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
x:Class="MortgageCalculator.Chart">
<ContentPage.Content>

<chart:SfChart HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" IsVisible="true" IsEnabled="true">
   <chart:SfChart.Title>
        <chart:ChartTitle Text="Weather Analysis"/>  
  </chart:SfChart.Title>

   <chart:SfChart.PrimaryAxis>
       <chart:CategoryAxis>
            <chart:CategoryAxis.Title>
                <chart:ChartAxisTitle Text="Month"/>
            </chart:CategoryAxis.Title>
       </chart:CategoryAxis>
   </chart:SfChart.PrimaryAxis>

   <chart:SfChart.SecondaryAxis>
       <chart:NumericalAxis>
           <chart:NumericalAxis.Title>
               <chart:ChartAxisTitle Text="Month"/>
           </chart:NumericalAxis.Title>
       </chart:NumericalAxis>
   </chart:SfChart.SecondaryAxis>

</chart:SfChart>

</ContentPage.Content>
</ContentPage>


GM Gobi M Syncfusion Team April 27, 2016 11:20 AM UTC

Hi Jacob, 
  
Thanks for using Syncfusion products. 
  
We have prepared a chart sample for your reference and it can be downloaded in below link. We suggest you to follow our online UG for getting started with SfChart, which can be accessible in below link.  
  
Sample: ChartSample 
  
  
Regards, 
Gobi M 



JM Jacob Miller April 29, 2016 01:11 AM UTC

Thanks for the quick reply,

In that example the chart is being written in c# and I'm looking to build it in xaml as that's how the rest of my app is already built. Do you have a charts example that has the chart coded in xaml as opposed to c#? as when i followed the tutorial that you linked I was still getting the issue of no chart rendering and I can't seem to find the issue as it is compiling with no errors.

Thanks,

Jacob 


GM Gobi M Syncfusion Team April 29, 2016 05:47 AM UTC

Hi Jacob, 
 
We have prepared a chart sample using xaml for your reference and it is available for download in the following link. Also make sure that you have added SfChartRenderer in your sample as suggested in document that is necessary to render the chart in view.  
 
 
If the issue still exists, could you please modify the attached sample to reproduce the issue? It will be helpful for us to analyze further and provide you a possible solution. 
 
Regards, 
Gobi M 


Loader.
Up arrow icon