jayzee1259 Posted July 13, 2010 Report Share Posted July 13, 2010 We are evaluating ChartFx for WPF and in particular the "Passing Data" / "Adjusting Data to the Chart" section of the guide For example: <Employee StartDate="10/31/2005" Name="Brenda" EmployeeID="10005" LastYearSales="54457" Sales="51719" /> <Employee StartDate="10/31/2005" Name="Brenda" EmployeeID="10005" LastYearSales="60000" Sales="65000" /> If we have TWO records for Employee Brenda, how can we plot that in a SCATTER Chart such a way that the second point with higher Sales is higher in the chart than thefirst point with lower sales number. Only interested in "Sales" series and NOT the "LastYearSales" series. What options do we have: New Series or Run it through a transform? What other options exist? Our applications typically have multiple points for the same X axis value, for example (x,y) include (5, 6), (5,8), (5,20) etc all have the same X and hence will plot in a straight line of X = 5. Thanks Quote Link to comment Share on other sites More sharing options...
JuanC Posted July 13, 2010 Report Share Posted July 13, 2010 I understand you want Sales to control the Y axis but it is not clear what would control the X axis ? StartDate? EmployeeID? Can you post a more complete data set along with a sketch of how the chart should look? JuanC Quote Link to comment Share on other sites More sharing options...
jayzee1259 Posted July 13, 2010 Author Report Share Posted July 13, 2010 Yes, Y-Axis = Sales X-Axis = Name (Could be StartDate or EmployeeID as well, since its the same for the 2 records). I couldn't insert a link, so I will describe... 1. Here's my XAML (its identical to the samples EXCEPT a new xml element for "Brenda" < XmlDataProvider x:Key="MyData" XPath="Employees/Employee"><x:XData> <Employees xmlns=""> <Employee StartDate="4/28/1993" Name="John" EmployeeID="10001" LastYearSales="49027" Sales="45815" /> <Employee StartDate="6/8/1997" Name="Robert" EmployeeID="10002" LastYearSales="51489" Sales="55652" /> <Employee StartDate="2/10/2001" Name="Mark" EmployeeID="10003" LastYearSales="51924" Sales="55075" /> <Employee StartDate="1/18/1998" Name="Kelly" EmployeeID="10004" LastYearSales="55227" Sales="36160" /> <Employee StartDate="10/31/2005" Name="Brenda" EmployeeID="10005" LastYearSales="54457" Sales="51719" /> <Employee StartDate="10/31/2005" Name="Brenda" EmployeeID="10005" LastYearSales="66123" Sales="60123" /> </Employees> </x:XData> 2. Code: SeriesAttributes series0 = new SeriesAttributes("@Sales"); series0.Gallery = Gallery.Scatter; chart1.AxisX.Labels.BindingPath = "@Name";chart1.Series.Add(series0); 3. This SHOWS 2 separate points for Brenda in the chart (X=Brenda, Y=51719) and (X= Brenda and Y=60123) What I would like is both these points to be one above the other. Please let me know if you need addtional info and/or how to send a screen shot and I can do that. Quote Link to comment Share on other sites More sharing options...
jayzee1259 Posted July 14, 2010 Author Report Share Posted July 14, 2010 We achieved by ARTIFICIALLY adding a Quote Link to comment Share on other sites More sharing options...
JuanC Posted July 16, 2010 Report Share Posted July 16, 2010 To achieve the chart you are looking for you will in fact need to use the CrosstabTransform, whether you can use an existing attribute to tell the crosstab transform which entries "belong" to the same point or not will depend on your data, e.g. you could use EmployeeID or Name instead of adding Year if showing these labels would make sense for your users. About the performance hit, crosstab will have a performance hit (should not be too bad) but even if you didn't use it you have to seriously consider/test if WPF and our control can handle processing 6000 records every 2 seconds and if the user will be able to process this information and act on it. JuanC Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.