Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
375
StackedColumnSeries to Display Histogram Plot
posted

I have been struggling with this from about 2 weeks now. I have a dynamic data set that depending on how the database is queried I will have 1 to n number of groups. Next I take the data and based on the number of buckets (columns) I catagorize the data into each bucket, then within the buckets by group. For the life of me I cannot ge the data the aligned such that the chart displays it.

 

I am using a CategoryXAxis, NumericYAxis, StackedColumnSeries and then multiple StackedFragmentSeries for each group. my data structure looks like this:

 

 

public class HistogramData

{

   public string sGroup {get; set;}

   public double dCount {get; set;}

 

    public HistogramData()

    {

        sGroup = "";

        dCount = 0;

    }

}

 

public class HistogramBuckets

{

    public string sBucket {get; set;}

    public ObservableCollection<HistogramData> ocData { get; set; }

 

    public HistogramBuckets()

    {

        sBucket = "";

        ocData = new ObservableCollection<HistogramData>();

    }

}

       


This is in my ViewModel

ObservableCollection<HistogramBuckets> _ocData;

public ObservableCollection<HistogramBuckets> ocData

 {

     get

            {

       return _ocData;

            }

      set

            {

         if (value != _ocData)

                {

                    _ocData =value;

                    NotifyPropertyChanged(m => m.ocData);

                }

            }

}

Then to populate this structure I have one loop to create the number of buckets (columns) and then a loop inside to create the groups within the buckets. I figured I could use the sBucket as my category for the X-Axis and then use the sGroups for each fragement using the dCount for the Y-Axis. What am I missing?

 

I am using the SL5 V12.1 NetAdvanage, in VS 2010.