Jump to content
Software FX Community

data values associated with wrong dates


User (Legacy)

Recommended Posts

I've got a serious problem that I can't solve. See the screenshot below. The data in the bottom pane is populated from the same DataTable as the Chart in the top pane. However notice first that the last column in the chart has no date label. Next notice that there is 1 fewer chart data item than there is in the table. Next, notice that the month/years don't line up right with their corresponding data columns. The chart actually has 2 Jan04 lables and 2 Mar04 labels.

What is going on here? I have verified that the table has the correct data. I'm populating the chart by setting the DataSource property.

ie. chart1.DataSource=tbl; where tbl is a DataTable.

I am doing all kinds of stuff in the code that sets up this chart in order to be dynamic so its possible I'm screwing something up but I can't imagine what.

Help!!

Link to comment
Share on other sites

We have the latest service packs. I also recuded the code down to a small example. which I'll post below.

I'll also post a new screenshot of the output from the reduced example.

We are using ChartFX for .NET v6.2 with ASP.NET

Our DataTable contains 3 columns: DATE, VALUE, and Row. Row is just an integer id value. Its sortof a ROWNUM column.

The "QueryContainer" object just holds my querys and returns a DataSet. The m_Sess object is an object we wrote. It strores and retrieves our query object.

Code:

Chart chart1 = new SoftwareFX.ChartFX.Internet.Server.Chart(this);

chart1.Gallery = SoftwareFX.ChartFX.Gallery.Bar;

chart1.BackColor=Color.White;

chart1.BorderEffect=BorderEffect.Raised;

chart1.Palette="Default.ChartFX6";

chart1.SerLegBox=true;

chart1.SerLegBoxObj.Alignment=ToolAlignment.Near;

chart1.SerLegBoxObj.Docked=Docked.Bottom;

chart1.AxisX.LabelAngle = 90;

QueryContainer qc=m_Sess.GetSessLargeVarObject(id) as QueryContainer;

QueryAnalysis qa=m_Sess.GetSessLargeVarObject(analysisId) as QueryAnalysis;

DataSet ds=new DataSet();

ds.Merge(qc.Execute(Conn));

DataTable tbl=ds.Tables[qc.Name];

//DEBUG//

foreach(DataRow row in tbl.Rows)

{

string dbgstr=string.Format("DATE={0} {1}, VALUE={2}, Row={3}",

((DateTime)row["DATE"]).ToShortDateString(),((DateTime)row["DATE"]).ToShortTimeString(),

row["VALUE"],row["Row"]);

Debug.WriteLine(dbgstr);

}

//END DEBUG//

chart1.DataSource=tbl;

chart1.GetHtmlData(650,400,"PNG");

Debug Output:

DATE=1/1/2004 12:00 AM, VALUE=72.8, Row=1

DATE=2/1/2004 12:00 AM, VALUE=72.4, Row=2

DATE=3/1/2004 12:00 AM, VALUE=73.3, Row=3

DATE=4/1/2004 12:00 AM, VALUE=75.9, Row=4

DATE=5/1/2004 12:00 AM, VALUE=73.9, Row=5

DATE=6/1/2004 12:00 AM, VALUE=71.4, Row=6

DATE=7/1/2004 12:00 AM, VALUE=73.2, Row=7

DATE=8/1/2004 12:00 AM, VALUE=73, Row=8

DATE=9/1/2004 12:00 AM, VALUE=73.3, Row=9

DATE=10/1/2004 12:00 AM, VALUE=72.6, Row=10

DATE=11/1/2004 12:00 AM, VALUE=73.7, Row=11

DATE=12/1/2004 12:00 AM, VALUE=72.1, Row=12

DATE=1/1/2005 12:00 AM, VALUE=72.7, Row=13

Updated ScreenShot:

"Thomas Moore" <tmoore@swri.org> wrote in message news:u1%23hKMzjGHA.1004@webserver3.softwarefx.com...

I've got a serious problem that I can't solve. See the screenshot below. The data in the bottom pane is populated from the same DataTable as the Chart in the top pane. However notice first that the last column in the chart has no date label. Next notice that there is 1 fewer chart data item than there is in the table. Next, notice that the month/years don't line up right with their corresponding data columns. The chart actually has 2 Jan04 lables and 2 Mar04 labels.

What is going on here? I have verified that the table has the correct data. I'm populating the chart by setting the DataSource property.

ie. chart1.DataSource=tbl; where tbl is a DataTable.

I am doing all kinds of stuff in the code that sets up this chart in order to be dynamic so its possible I'm screwing something up but I can't imagine what.

Help!!

post-2107-13922378244341_thumb.png

Link to comment
Share on other sites

We are unable to reproduce this problem. Please export the chart to a binary 

file using the Export method right before calling GetHtmlData and attach it

to your post.

--

Francisco Padron

www.chartfx.com

"Thomas Moore" <tmoore@swri.org> wrote in message

news:vrSjIO9jGHA.3060@webserver3.softwarefx.com...

We have the latest service packs. I also recuded the code down to a small

example. which I'll post below.

I'll also post a new screenshot of the output from the reduced example.

We are using ChartFX for .NET v6.2 with ASP.NET

Our DataTable contains 3 columns: DATE, VALUE, and Row. Row is just an

integer id value. Its sortof a ROWNUM column.

The "QueryContainer" object just holds my querys and returns a DataSet. The

m_Sess object is an object we wrote. It strores and retrieves our query

object.

Code:

Chart chart1 = new SoftwareFX.ChartFX.Internet.Server.Chart(this);

chart1.Gallery = SoftwareFX.ChartFX.Gallery.Bar;

chart1.BackColor=Color.White;

chart1.BorderEffect=BorderEffect.Raised;

chart1.Palette="Default.ChartFX6";

chart1.SerLegBox=true;

chart1.SerLegBoxObj.Alignment=ToolAlignment.Near;

chart1.SerLegBoxObj.Docked=Docked.Bottom;

chart1.AxisX.LabelAngle = 90;

QueryContainer qc=m_Sess.GetSessLargeVarObject(id) as QueryContainer;

QueryAnalysis qa=m_Sess.GetSessLargeVarObject(analysisId) as

QueryAnalysis;

DataSet ds=new DataSet();

ds.Merge(qc.Execute(Conn));

DataTable tbl=ds.Tables[qc.Name];

//DEBUG//

foreach(DataRow row in tbl.Rows)

{

string dbgstr=string.Format("DATE={0} {1}, VALUE={2}, Row={3}",

((DateTime)row["DATE"]).ToShortDateString(),((DateTime)row["DATE"]).ToShortTimeString(),

row["VALUE"],row["Row"]);

Debug.WriteLine(dbgstr);

}

//END DEBUG//

chart1.DataSource=tbl;

chart1.GetHtmlData(650,400,"PNG");

Debug Output:

DATE=1/1/2004 12:00 AM, VALUE=72.8, Row=1

DATE=2/1/2004 12:00 AM, VALUE=72.4, Row=2

DATE=3/1/2004 12:00 AM, VALUE=73.3, Row=3

DATE=4/1/2004 12:00 AM, VALUE=75.9, Row=4

DATE=5/1/2004 12:00 AM, VALUE=73.9, Row=5

DATE=6/1/2004 12:00 AM, VALUE=71.4, Row=6

DATE=7/1/2004 12:00 AM, VALUE=73.2, Row=7

DATE=8/1/2004 12:00 AM, VALUE=73, Row=8

DATE=9/1/2004 12:00 AM, VALUE=73.3, Row=9

DATE=10/1/2004 12:00 AM, VALUE=72.6, Row=10

DATE=11/1/2004 12:00 AM, VALUE=73.7, Row=11

DATE=12/1/2004 12:00 AM, VALUE=72.1, Row=12

DATE=1/1/2005 12:00 AM, VALUE=72.7, Row=13

Updated ScreenShot:

"Thomas Moore" <tmoore@swri.org> wrote in message

news:u1%23hKMzjGHA.1004@webserver3.softwarefx.com...

I've got a serious problem that I can't solve. See the screenshot below. The

data in the bottom pane is populated from the same DataTable as the Chart in

the top pane. However notice first that the last column in the chart has no

date label. Next notice that there is 1 fewer chart data item than there is

in the table. Next, notice that the month/years don't line up right with

their corresponding data columns. The chart actually has 2 Jan04 lables and

2 Mar04 labels.

What is going on here? I have verified that the table has the correct data.

I'm populating the chart by setting the DataSource property.

ie. chart1.DataSource=tbl; where tbl is a DataTable.

I am doing all kinds of stuff in the code that sets up this chart in order

to be dynamic so its possible I'm screwing something up but I can't imagine

what.

Help!!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...