Jump to content
Software FX Community

Charting Multiple Points


Recommended Posts

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 the
  • first 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.



Link to comment
Share on other sites

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">


<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" />




2. Code:

SeriesAttributes series0 = new SeriesAttributes("@Sales");

series0.Gallery = Gallery.Scatter;

chart1.AxisX.Labels.BindingPath =



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.

Link to comment
Share on other sites

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.


Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...