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.

SfChart Histogram Yaxis range setting

Thread ID:

Created:

Updated:

Platform:

Replies:

129428 Mar 16,2017 07:30 PM Mar 20,2017 06:36 AM WPF 3
loading
Tags: SfChart
llllllllll
Asked On March 16, 2017 07:57 PM

My Y binding data for  HistogramSeries definitely has frequency counts of more than 1. However, after binding, it detects that the maximum is 1 and plots my histogram as shown below.

The x axis is fine.

My understanding for HistogramSeries data is
X data -> location of each bin
Y data -> Number of counts in each bin
and then I set some bin interval.
Is this correct? If not, what is the series expecting for X and Y data?


Below is the code that I use.

=====================================================

var plotPoints = new ObservableCollection<HistoPlotPoint>();

            foreach (var pt in pgDataSet.Histogram.HistogramPoints)

            {

                plotPoints.Add(new HistoPlotPoint(pt.X, pt.Y));

            }

 

            // Perform Data Binding

            var series = new HistogramSeries();

            series.ItemsSource = plotPoints;

            series.XBindingPath = "X";

            series.YBindingPath = "Y";

            series.HistogramInterval = pgDataSet.Histogram.BucketSize;

            series.ShowTooltip = true;

           

            series.Interior = Brushes.Orange;

           

            series.ShowNormalDistributionCurve = true;

           

            chart.Series.Add(series);



=====================================================

private class HistoPlotPoint




{



public HistoPlotPoint(double x, double y, string toolTip = null)




{



X = x;


Y = (int) y;


ToolTip = toolTip;




}



public double X { get; set; }


public int Y { get; set; }


public string ToolTip { get; set; }




}



Devi Aruna Maharasi Murugan [Syncfusion]
Replied On March 17, 2017 05:34 AM

Hi Keenan, 
  
Thanks for contacting Syncfusion Support. 
  
In SfChart, the histogram series Y-values are calculated internally as number of x-values fall in each bin (in provided HistogramInterval). So, we no need to define Y-data (Number of count in each bin) externally in sample.  
  
We have prepared a demo sample with histogram series for your reference and it can be downloaded from below link, 
  
Sample: HistogramSample 
  
Please find the output screenshot for the above code snippet 
 
  
Regards, 
Devi 
 


llllllllll
Replied On March 17, 2017 11:00 AM

Thank you. I can get my histogram working now.

However, I do not understand why in the example you have histogram.YBindingPath = "Value" when only Model.Price is set but Model.Value is null. Why is histogram.YBindingPath = "Value" needed and what does it do?

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On March 20, 2017 06:36 AM

Hi Keenan, 
  
Thanks for your update. 
  
We would like to inform you that we have generated data points for all the XYDataSeries based on XBindingPath and YBindingPath property. So, we must specify the YBindingPath for HistogramSeries (here we can define the empty YData). 
  
As we mentioned in our earlier update, we have calculated Y-Values internally based on the number of X-values falls in each bin. 
  
Regards, 
Devi 


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.

;