Page 1 of 1

TeeChart3.5 in ASP. Extent data series

Posted: Wed Aug 12, 2009 2:38 pm
by 13052858
I have a problem extending the data series (FastTrend).
When I extend the data in Chart.Series[0] (is a FastTrend object, I see the axis scale to display the new value, but the new point in the chart is not
connected with a line to the old points (that were already present in the Series[0]).

The TeeView properties:
TempChart = Session;
FastLine.XAxis shows DateTime objects

What am I missing to draw a line between the data that is already present and the new point added to the data series ?


The code I use:

protected void Page_Load(object sender, EventArgs e)
{
MemoryStream tmpChart;
if (Session["Chart"] == null)
{
InitNewChart(WebChart1.Chart);
tmpChart = new MemoryStream();
WebChart1.Chart.Export.Template.Save(tmpChart);
Session.Add("Chart", tmpChart);
}
else
{
// retrieve chart stored in Session object
tmpChart = (MemoryStream)Session["Chart"];
// force stream position to 0
tmpChart.Position = 0;
WebChart1.Chart.Import.Template.Load(tmpChart);
FastLine fs = (FastLine)WebChart1.Chart.Series[0];
fs.Add(DateTime.Now, 5);
}

Re: TeeChart3.5 in ASP. Extent data series

Posted: Thu Aug 13, 2009 9:20 am
by 10050769
Hello marcoIpcos,

I made a simple example using last verision of TeeChartFor.Net 3.5 in Asp and your code, please check that next code works as you want in your application:

Code: Select all

 protected void Page_Load(object sender, EventArgs e)
    {

            System.IO.MemoryStream tmpChart;
            DateTime today = DateTime.Today;
            TimeSpan oneday = TimeSpan.FromDays(1);
            Steema.TeeChart.Styles.FastLine fs = new Steema.TeeChart.Styles.FastLine(WebChart1.Chart);
            
            Random rnd = new Random();
            WebChart1.Chart.Axes.Bottom.Labels.Angle = 90;
            for (int i = 0; i < 10; i++)
            {
                fs.Add(today, rnd.Next(100));
                today += oneday;
            }
            fs.YValues.Order = Steema.TeeChart.Styles.ValueListOrder.Descending;
            fs.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None;
            if (Session["Chart"] == null)
            {
            tmpChart = new System.IO.MemoryStream();
            WebChart1.Chart.Export.Template.Save(tmpChart);
            Session.Add("Chart", tmpChart);
            }
            else
            {
                DateTime date1 = DateTime.Today;
            // retrieve chart stored in Session object
            tmpChart = (System.IO.MemoryStream)Session["Chart"];
             //force stream position to 0
            tmpChart.Position = 0;
            WebChart1.Chart.Import.Template.Load(tmpChart);
            Steema.TeeChart.Styles.FastLine fs1 = (Steema.TeeChart.Styles.FastLine)WebChart1.Chart.Series[0];
            fs1.Add(date1.AddDays(11), 5);
            }
    

    }
If this code doesn't do what you want, please explain exactly what is your problem or send a us a simple project that appears this problem. You could attach your projects directly in the forums post.

Thanks,

Re: TeeChart3.5 in ASP. Extent data series

Posted: Wed Aug 19, 2009 6:34 am
by 13052858
Thanks, it solved my problem!!