User (Legacy) Posted December 18, 2006 Author Report Share Posted December 18, 2006 Hi, I'm trying to create a line graph with 2 series using a datatable in .NET. The data looks like this: Date ActualQty GoalQty 20061201 100 Null 20061202 300 250 20061203 500 Null 20061204 200 Null 20061205 400 Null 20061206 500 Null 20061207 600 Null 20061208 300 Null 20061209 250 300 20061210 220 Null I want to have the lines in each series be connected. The GoalQty is sporadic but I want it to be drawn with connecting lines between each point. Right now they come out as single points. Below is a sample graph, see the green points below... Is there a way to make the second series points connect? Thanks, Chris Link to comment Share on other sites More sharing options...
User (Legacy) Posted December 18, 2006 Report Share Posted December 18, 2006 Hi, I'm trying to create a line graph with 2 series using a datatable in .NET. The data looks like this: Date ActualQty GoalQty 20061201 100 Null 20061202 300 250 20061203 500 Null 20061204 200 Null 20061205 400 Null 20061206 500 Null 20061207 600 Null 20061208 300 Null 20061209 250 300 20061210 220 Null I want to have the lines in each series be connected. The GoalQty is sporadic but I want it to be drawn with connecting lines between each point. Right now they come out as single points. Below is a sample graph, see the green points below... Is there a way to make the second series points connect? Thanks, Chris Link to comment Share on other sites More sharing options...
Software FX Posted December 18, 2006 Report Share Posted December 18, 2006 In order to obtain two lines you will need to re-organize your data as follows: Date1 ActualQty Date2 GoalQty 20061201 100 20061202 250 20061202 300 20061209 300 20061203 500 Null Null 20061204 200 Null Null 20061205 400 Null Null 20061206 500 Null Null 20061207 600 Null Null 20061208 300 Null Null 20061209 250 Null Null 20061210 220 Null Null Notice that there is two separate set of X-Values and the Null's are all at the end. The dates in the second set of X-Values are sorted, the dates tat contain data go first. -- Francisco Padron www.chartfx.com Link to comment Share on other sites More sharing options...
Software FX Posted December 18, 2006 Report Share Posted December 18, 2006 In order to obtain two lines you will need to re-organize your data as follows: Date1 ActualQty Date2 GoalQty 20061201 100 20061202 250 20061202 300 20061209 300 20061203 500 Null Null 20061204 200 Null Null 20061205 400 Null Null 20061206 500 Null Null 20061207 600 Null Null 20061208 300 Null Null 20061209 250 Null Null 20061210 220 Null Null Notice that there is two separate set of X-Values and the Null's are all at the end. The dates in the second set of X-Values are sorted, the dates tat contain data go first. -- Francisco Padron www.chartfx.com Link to comment Share on other sites More sharing options...
User (Legacy) Posted December 19, 2006 Author Report Share Posted December 19, 2006 Hi, Thanks for the reply. Right now I'm using using a datatable and just binding to the chart with something like: Chart1.DataSourceSettings.DataType(0) = DataType.Label Chart1.DataSourceSettings.DataType(1) = DataType.Value Chart1.DataSourceSettings.DataType(2) = DataType.Value Chart1.DataSourceSettings.DataSource = dt Chart1.DataBind() There's a lot of other code, but basically it just sets the colors and fonts. Will I be able to do something similar or will I have to input the values manually into the chart? Thanks, Chris "Software FX" <noreply@softwarefx.com> wrote in message news:dJmefDwIHHA.244@webserver3.softwarefx.com... > In order to obtain two lines you will need to re-organize your data as > follows: > > Date1 ActualQty Date2 GoalQty > > 20061201 100 20061202 250 > 20061202 300 20061209 300 > 20061203 500 Null Null > 20061204 200 Null Null > 20061205 400 Null Null > 20061206 500 Null Null > 20061207 600 Null Null > 20061208 300 Null Null > 20061209 250 Null Null > 20061210 220 Null Null > > > Notice that there is two separate set of X-Values and the Null's are all > at the end. The dates in the second set of X-Values are sorted, the dates > tat contain data go first. > > -- > Francisco Padron > www.chartfx.com > Link to comment Share on other sites More sharing options...
User (Legacy) Posted December 19, 2006 Author Report Share Posted December 19, 2006 Hi, Thanks for the reply. Right now I'm using using a datatable and just binding to the chart with something like: Chart1.DataSourceSettings.DataType(0) = DataType.Label Chart1.DataSourceSettings.DataType(1) = DataType.Value Chart1.DataSourceSettings.DataType(2) = DataType.Value Chart1.DataSourceSettings.DataSource = dt Chart1.DataBind() There's a lot of other code, but basically it just sets the colors and fonts. Will I be able to do something similar or will I have to input the values manually into the chart? Thanks, Chris "Software FX" <noreply@softwarefx.com> wrote in message news:dJmefDwIHHA.244@webserver3.softwarefx.com... > In order to obtain two lines you will need to re-organize your data as > follows: > > Date1 ActualQty Date2 GoalQty > > 20061201 100 20061202 250 > 20061202 300 20061209 300 > 20061203 500 Null Null > 20061204 200 Null Null > 20061205 400 Null Null > 20061206 500 Null Null > 20061207 600 Null Null > 20061208 300 Null Null > 20061209 250 Null Null > 20061210 220 Null Null > > > Notice that there is two separate set of X-Values and the Null's are all > at the end. The dates in the second set of X-Values are sorted, the dates > tat contain data go first. > > -- > Francisco Padron > www.chartfx.com > Link to comment Share on other sites More sharing options...
Software FX Posted December 22, 2006 Report Share Posted December 22, 2006 The solution I proposed is for DataBinding. You will, however, need to change the format of your DataTable in the way I suggested. -- Francisco Padron www.chartfx.com Link to comment Share on other sites More sharing options...
Software FX Posted December 22, 2006 Report Share Posted December 22, 2006 The solution I proposed is for DataBinding. You will, however, need to change the format of your DataTable in the way I suggested. -- Francisco Padron www.chartfx.com Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.