Jump to content
Software FX Community

multiple series not working for webapp


User (Legacy)

Recommended Posts

hello,

I am writing a web app using c# and asp.net.

I am trying to plot time v/s data XY line chart. I want my chart to plot

multiple series as per the selection made by the user over the calendar. In

detail..i have a calendar and as per the user selection suppose 2nd day of a

particular month, my chart would plot data available for that 2nd day over

time as x-axis.

This first dataset contains time| data ..two columns. Now on next selection

suppose 5th day, The chart control should plot the data for 2nd aswell as

5th day as two diff series over the period of time ( ie. 24 hrs ie. 1 day

labelled according to the time).

heres what i do....

bear with me for this long description but I am trying over days..to fix

this problem or trying to draw multiple series..( for now only 2 seris if i

can get working)...it would b fine..but it.doesn't work..I donot want

secondary Y-axis.

plz suggest me how to overcome this..problem...

if((DataSet)Session["dataset"]!=null)

{

//dataSet = (DataSet)Session["dataset"];

string sql = "SELECT TimestampUTC, Data FROM IntervalData WHERE MeterTagId=1

";

sql += "AND TimestampUTC >='"+startdate+"' AND TimeStampUTC <='"+enddate+"'"

;

new_dataSet = getdataSet(sql, "GraphTable");

}

else

{

string sql = "SELECT TimestampUTC, Data FROM IntervalData WHERE MeterTagId=1

";

sql += "AND TimestampUTC >='"+startdate+"' AND TimeStampUTC <='"+enddate+"'"

;

dataSet = getDataset(sql, "Graph");

Session["dataset"] = dataSet;

}

if(new_dataSet!=null)

{

dataSet = (DataSet)Session["dataset"];

int count = dataSet.Tables["Graph"].Columns.Count / 2;

new_dataSet.Tables["GraphTable"].Columns[0].ColumnName =

new_dataSet.Tables["GraphTable"].Columns[0].ColumnName + count;

new_dataSet.Tables["GraphTable"].Columns[1].ColumnName =

new_dataSet.Tables["GraphTable"].Columns[1].ColumnName + count;

DataColumn column1 = new_dataSet.Tables["GraphTable"].Columns[0];

new_dataSet.Tables["GraphTable"].Columns.RemoveAt(0);

dataSet.Tables["Graph"].Columns.Add(column1);

DataColumn column2 = new_dataSet.Tables["GraphTable"].Columns[0];

new_dataSet.Tables["GraphTable"].Columns.RemoveAt(0);

dataSet.Tables["Graph"].Columns.Add(column2);

}

else

dataSet = (DataSet)Session["dataset"];

if(new_dataSet!=null)

{

// set up secondary Y-Axis

// chart.EnableViewState = false;

// chart.Axis[(int)SoftwareFX.ChartFX.YAxis.Secondary].Visible = true;

// chart.DataEditor = false;

// chart.Series[0].YAxis = SoftwareFX.ChartFX.YAxis.Main;

// chart.Series[1].YAxis = SoftwareFX.ChartFX.YAxis.Secondary;

// chart.DataStyle = chart.DataStyle | SoftwareFX.ChartFX.DataStyle.Default;

chart.DataType[0] = SoftwareFX.ChartFX.DataType.XValue;

chart.DataType[1] = SoftwareFX.ChartFX.DataType.Value;

chart.DataType[2] = SoftwareFX.ChartFX.DataType.XValue;

chart.DataType[3] = SoftwareFX.ChartFX.DataType.Value;

}

chart.DataSource = dataSet.Tables["Graph"];

chart.DataBind();

}// end drawchart

Link to comment
Share on other sites

I am using Beta for .net.

I figured out today that the two colums which i add from a diff table to the

previous dataset do get added as time1|data1 but they do shallow copy

meaning the rows have null values. thats the reason even after the datatype

of each column is set it isn't giving me required result. I am using

Csharp. Can u suggest a method to copy two columns from a diff table to the

previous dataSet along with all the rows and its values.

a short code for such copy would b helpful...

thanks

BYG

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:av9Qg4FxBHA.1412@webserver1.softwarefx.com...

> Are you using Chart FX 5.0 or Chart FX 6.0 BETA (for .NET) ?

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...