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
close icon

SfChart, label, image datamarker

Hello,

I attached two files.
- One contains the result I want to my android SfChart
- The second is the actual rendering


How to modify the current code to have this rendering ?

I use the following code :

SfChart chart = new SfChart(Activity);
            chart.VerticalScrollBarEnabled = false;
            chart.HorizontalScrollBarEnabled = false;

            CategoryAxis primaryAxis = new CategoryAxis();
            primaryAxis.Visibility = Visibility.Gone;
            primaryAxis.StripLines.Clear();
            primaryAxis.ShowMajorGridLines = false;
            chart.PrimaryAxis = primaryAxis;

            NumericalAxis secondaryAxis = new NumericalAxis();
            secondaryAxis.Visibility = Visibility.Gone;
            secondaryAxis.StripLines.Clear();
            secondaryAxis.ShowMajorGridLines = false;
            chart.SecondaryAxis = secondaryAxis;

            List<Integer> colors = new List<Integer>();
            ObservableArrayList data = new ObservableArrayList();
            foreach (ParticipantViewModel participantViewModel in this._participants.Where(x => x.Difference != 0))
            {
                data.Add(new ChartDataPoint(participantViewModel.Name, participantViewModel.Difference));
                if (participantViewModel.Difference > 0)
                    colors.Add(new Integer(new Color(Constants.ColorPositiveR, Constants.ColorPositiveG, Constants.ColorPositiveB)));
                else
                    colors.Add(new Integer(new Color(Constants.ColorNegativeR, Constants.ColorNegativeG, Constants.ColorNegativeB)));
            }

            ColumnSeries series1 = new ColumnSeries()
            {
                DataSource = data,
                TooltipEnabled = true,
                AnimationEnabled = true,
                AnimationDuration = 0.2,
                Label = "Income"
            };
            series1.ColorModel.ColorPalette = ChartColorPalette.Custom;
            series1.ColorModel.CustomColors = colors;
            series1.DataMarker.MarkerType = DataMarkerType.Ellipse;
            series1.DataMarker.ShowMarker = true;
            series1.DataMarker.ShowLabel = true;
            chart.Series.Add(series1);

Attachment: Pictures_95b48d51.7z

1 Reply

YP Yuvaraj Palanisamy Syncfusion Team September 21, 2016 03:12 PM UTC

Hi Tincani, 
 
We have already logged a feature report for DataMarker Label Template support in Xamarin.Forms and this will be available in our upcoming Volume 3, 2016 release which is estimated to be rolled out by end of September, 2016.  
 
Disclaimer : The date for the feature implementation is tentative and not a commitment on our parts.  
 
Regards, 
Yuvaraj 


Loader.
Live Chat Icon For mobile
Up arrow icon