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.

ColumnSeries not showing

Thread ID:

Created:

Updated:

Platform:

Replies:

124958 Jul 11,2016 05:57 AM Jul 12,2016 09:16 AM Xamarin.Forms 1
loading
Tags: SfChart
Marco Bellini
Asked On July 11, 2016 05:57 AM

Hi, I'm trying to render a graph with some ColumnSeries, with no luck. Here's the Xaml

<StackLayout>
<Grid BackgroundColor="{StaticResource PageSectionBackground}" HeightRequest="200" Padding="0">
<chart:SfChart x:Name="SegnalazioniChart" VerticalOptions="FillAndExpand">
<chart:SfChart.Series>
<chart:ColumnSeries ItemsSource="{Binding Segnalazioni}" Label="Accordato" Color="#dbdeea" EnableAnimation="true" AnimationDuration="0.8" EnableTooltip="True" YBindingPath="ImportoAccordato" XBindingPath="Mese" />
<chart:ColumnSeries ItemsSource="{Binding Segnalazioni}" Label="Utilizzato" StrokeWidth="5" Color="#9acc49" EnableAnimation="true" AnimationDuration="0.8" EnableTooltip="True" YBindingPath="ImportoUtilizzato" XBindingPath="Mese" />
<chart:ColumnSeries ItemsSource="{Binding Segnalazioni}" Label="Garantito" StrokeWidth="5" Color="#f5a623" EnableAnimation="true" AnimationDuration="0.8" EnableTooltip="True" YBindingPath="ImportoGarantito" XBindingPath="Mese" />
</chart:SfChart.Series>
<chart:SfChart.Legend>
<chart:ChartLegend DockPosition="Bottom" />
</chart:SfChart.Legend>
<chart:SfChart.Title>
<chart:ChartTitle Text="Dettaglio ultime 12 segnalazioni" TextAlignment="Start" TextColor="{StaticResource TitleText}" Margin="7,0" />
</chart:SfChart.Title>
<chart:SfChart.PrimaryAxis>
<chart:CategoryAxis ShowMajorGridLines="true">
</chart:CategoryAxis>
</chart:SfChart.PrimaryAxis>
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis ShowMajorGridLines="false" Minimum="0" Maximum="10000" ShowMinorGridLines="false" MinorTicksPerInterval="1" IsVisible="true" RangePadding="Auto">
</chart:NumericalAxis>
</chart:SfChart.SecondaryAxis>
<chart:SfChart.ChartBehaviors>
<chart:ChartZoomPanBehavior EnablePanning="true" EnableDoubleTap="false" />
</chart:SfChart.ChartBehaviors>
</chart:SfChart>
</Grid>
</StackLayout>


viewmodel:

public class Segnalazione
    {
        public string Mese { get; set; }
        public double ImportoAccordato { get; set; }
        public double ImportoUtilizzato { get; set; }
        public double ImportoGarantito { get; set; }
    }

    public class SegnalazioniViewModel : ViewModelBase
    {
        private UserData _userData;

        public ObservableCollection<Segnalazione> Segnalazioni = new ObservableCollection<Segnalazione>();

        public SegnalazioniViewModel(INavigation navigation) : base(navigation)
        {
            LoadData();
        }

        private void LoadData()
        {
            _userData = DataManager.GetUserData();

            foreach (var segnalazione in _userData.Segnalazioni)
            {
                Segnalazioni.Add(new Segnalazione
                {
                    Mese = new DateTime(segnalazione.Anno, segnalazione.Mese, 1).ToString("MMM"),
                    ImportoAccordato = segnalazione.ImportoAccordato,
                    ImportoGarantito = segnalazione.ImportoGarantito,
                    ImportoUtilizzato = segnalazione.ImportoUtilizzato
                });
            }
        }
    }

Graph is showing up, but the series is not. What I'm doing wrong?

Yuvaraj Palanisamy [Syncfusion]
Replied On July 12, 2016 09:16 AM

Hi Marco Bellini,

Thanks for contacting Syncfusion support.

We are not able to reproduce the reported issue at our end and we have prepared a sample for this. Please revert us the modified sample based on your requirement which will be helpful for further assistance.

Sample: http://www.syncfusion.com/downloads/support/forum/124958/ze/ColumnSeries-1212741133  

Thanks,
Yuvaraj 


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.

;