Jump to content
Software FX Community

Data merge issue (date different in dataset)


shane2004
 Share

Recommended Posts

Hi,  I used dataset built-in merge function to merge multiple series chart, however it is running into a problem when date (primary key) is different. So the chartfx is merging them as different rows, and obivously the chart is looking very wrong, so is there any better way to merge data before generating the chart

For example, data sample as this below. How would I be able to draw a smooth lin on the product A firstly then Product B on top of that?

Product A  Price  Prouct B Price 

05/09/2008 05/09/2008 1826.48

06/09/2008 2612.47 06/09/2008 

11/09/2008 2612.47 11/09/2008 

12/09/2008  12/09/2008 1794.11

19/09/2008  19/09/2008 1841.30

20/09/2008 2612.47  20/09/2008 

26/09/2008  26/09/2008 1868.39

27/09/2008 2612.47 27/09/2008 

03/10/2008   03/10/2008 1792.23

04/10/2008 2612.47 04/10/2008 

10/10/2008 10/10/2008 1717.13

11/10/2008 2612.47  11/10/2008 

17/10/2008  17/10/2008 1716.14

18/10/2008 2612.47 18/10/2008 

24/10/2008   24/10/2008 1602.07

25/10/2008 2612.47  25/10/2008 

31/10/2008 2612.47 31/10/2008 1625.00

07/11/2008 2612.47 07/11/2008 1632.70

14/11/2008 2612.47  14/11/2008 1565.74

 

Link to comment
Share on other sites

Hi,

For the first request, based on the data you provided, it seems like dates are the same for both A and B. Therefore you simply have a redundant column of data. You can simply use one of the date columns for both columns:

adapter.Fill(ds, "Financial");                
chart1.DataSourceSettings.Fields.Add(new FieldMap("Date",FieldUsage.Labels));                
chart1.DataSourceSettings.Fields.Add(new FieldMap("SeriesA",FieldUsage.Value));                
chart1.DataSourceSettings.Fields.Add(new FieldMap("SeriesB",FieldUsage.Value));                              
chart1.DataSource = ds.Tables[0];  
Also, in order for Chart FX to ignore the gaps between points , you can use the InterpolateHidden property 
chart1.Data.InterpolateHidden = true;
 You can use this same property for your second issue.
 Regards,
 TT 
 
 
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.

Guest
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.

 Share

×
×
  • Create New...