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
40
Dataset for Multiple Series
posted

Hi, 

I want to build a Line chart to compare two different values during a time period say comparing cost with number of peope present. This means I will have two time series data (one with people cound and date time and the other with cost with datetime) which comes from two different sources. I want to combine them into same datachart with two series. 

Suppose I have the data set like below which has  a key value pair one with date time and the other as value

 

Cost = [<00:00, 10>,<01:00, 20>,<02:00, 10>,<03:00, 14>,<04:00, 10>,<05:00, 39>,<06:00, 1>]
People = [<00:09, 1123>,<01:09, 124>,<08:12, 10>,<09:00, 19>,<10:09, 13>,<11:00, 39>,<12:00, 1>,<13:15, 394>,<15:00, 349>,<16:03, 39>,<23:00, 39>]

How would I represnt these two data  by two line series in a same data chart?

Thanks

Parents
  • 12875
    posted

    Hi, 

    Looking into your inquiry, it appears that you believe that you need to use two separate data sources. However it seems more likely that you would use one datasource that contains all of the values (date, cost and number of people). 

    From your description of the value pairs, I would assume that the cost and number of people are related based on a timestamp value.  So you could have a datetime value with a cost and a number of people present. 

    Then you would have one two numeric series and one shared CategoryXAxis related to the dateTime value. 

    I’ve created a sample that demonstrates my suggestion. 

    Please let me know if this is helpful to you.

     

    WPF_xamDataChart_LineSeries.zip
Reply Children