Ask a questionAsk a question
 

QuestionDatasource with multiple series info

  • Thursday, November 05, 2009 4:38 PMjrich Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    i'd like a line graph with multiple lines. the data source i have has 3 fields, TSID (series), value, date
    there are about 3 different TSIDs (end up with 3 lines)

    i have a feeling this shouldnt be too hard but i just cant wrap my head around it.

    Thanks
    Justin

All Replies

  • Thursday, November 05, 2009 6:07 PMCole Brand Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    i'd like a line graph with multiple lines. the data source i have has 3 fields, TSID (series), value, date
    there are about 3 different TSIDs (end up with 3 lines)

    i have a feeling this shouldnt be too hard but i just cant wrap my head around it.

    Thanks
    Justin


    Well, what have you gotten into so far? I presume you've examined the websamples? If you can help us we can help you...

    Please don't forget (and feel free to remind me) to post if you got the answer you wanted, and select who really answered your post when you do so future visitors will know too! Remember, this is .NET 4.0 in a .NET 3.5 world, you're a pioneer right now.
  • Friday, November 06, 2009 3:12 PMjrich Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    so i was able to find a way to do it... not sure its the best way..  had to use a dataset rather than a data source..
    this is sorta test code, i'll create the series on the fly rather than create a bunch static as i did in this example..

    DataSet

     

    ds = new DataSet();

    da.Fill(ds);

     

    DataTable tsids = ds.Tables[0].DefaultView.ToTable(true, "tsid");

     

    int series = 0;

     

    foreach (DataRow a in tsids.Rows)

    {

     

    string tsid = a[0].ToString();

    Chart1.Series[series].Points.DataBind(ds.Tables[0].Select(

    "tsid=" + tsid), "sdate","tsfree","");

    series++;

    }