ASP.NET zooming with Financial Volume Graph
ASP.NET zooming with Financial Volume Graph
Hi,
I'm working on a ASP.NET app in VS 2005 which uses a Volume Graph.
The graph gets data from a database which is stored in a C# DataSet then series are addeed based on the contents of the dataset. The graph is rendered correctly, however when I attempt using the ZOOM tool, with post back, I get an empty graph - the axis labels look correct but there is NO data.
Any ideas?
thanks,
Rich
I'm working on a ASP.NET app in VS 2005 which uses a Volume Graph.
The graph gets data from a database which is stored in a C# DataSet then series are addeed based on the contents of the dataset. The graph is rendered correctly, however when I attempt using the ZOOM tool, with post back, I get an empty graph - the axis labels look correct but there is NO data.
Any ideas?
thanks,
Rich
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rich,
Could you please send us a simple example project we can run "as-is" to reproduce the problem here? You may use random data or a dataset as in the example Christopher Ireland posted here
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Could you please send us a simple example project we can run "as-is" to reproduce the problem here? You may use random data or a dataset as in the example Christopher Ireland posted here
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
poseted files
I have a Database object that supplies data - as you';ll see in the code...you can change those db.... calls to random data I suppose - but it's probably important that the data is then staored in dataseets.
thanks,
Rich
thanks,
Rich
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rich,
Thanks for the code. However I'm not able to run and debug it here as it uses a number of controls we don't have here.
At first glance I see that you call CheckZoom method twice, in the ChartSession method and in Page_Load. I recommend you to try removing the call at ChartSession.
Also notice that for using zoom you should set chart's AutoPostback to false.
If this doesn't help please send us a simple example project we can run "as-is" to reproduce the problem here.
Thanks in advance.
Thanks for the code. However I'm not able to run and debug it here as it uses a number of controls we don't have here.
At first glance I see that you call CheckZoom method twice, in the ChartSession method and in Page_Load. I recommend you to try removing the call at ChartSession.
Also notice that for using zoom you should set chart's AutoPostback to false.
If this doesn't help please send us a simple example project we can run "as-is" to reproduce the problem here.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
GetChart?
Hi,
Thanks for your quick response! I'll see if I can put together someting simple to send...in the meantime I have a question. If I'm using "httpHandler" for TempChart, do I still need a GetChart.aspx file?
Also, since the data I'm filling the chart with data stored in a Session variable of type DataSet, Will this variable need to be retrieved and again tied to the Chart during the checkZoom postback?
thanks,
Rich Heim
Thanks for your quick response! I'll see if I can put together someting simple to send...in the meantime I have a question. If I'm using "httpHandler" for TempChart, do I still need a GetChart.aspx file?
Also, since the data I'm filling the chart with data stored in a Session variable of type DataSet, Will this variable need to be retrieved and again tied to the Chart during the checkZoom postback?
thanks,
Rich Heim
Another question
Sorry - one more question:
Has the TeeChart ASP.NET library been tested with Microsoft's ASP.NET AJAX extensions?
thanks again,
Rich
Has the TeeChart ASP.NET library been tested with Microsoft's ASP.NET AJAX extensions?
thanks again,
Rich
More Files
I sent a simple example today w/o ajax.
Files are Default.aspx, Default.aspx.cs, config.xml, and DataBaseExample.cs
thanks,
Rich
Files are Default.aspx, Default.aspx.cs, config.xml, and DataBaseExample.cs
thanks,
Rich
Web.config
Opps!
Make that web.config NOT config.xml
thanks again
Rich
Make that web.config NOT config.xml
thanks again
Rich
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rich,
I also strongly recommend you to read this thread about similar issue.
There are some live examples of that included with the live ASP.NET demo, like the scrolling example, if you'd like a closer look.
No, in that case it's not necessary, you just need to modify web.config as described in Tutorial 9 - TeeChart and WebChart and ASP.NET. Tutorials can be found at TeeChart's program group.Thanks for your quick response! I'll see if I can put together someting simple to send...in the meantime I have a question. If I'm using "httpHandler" for TempChart, do I still need a GetChart.aspx file?
It is not strictly necessary as when exporting/importing the chart to the MemoryStream it already includes its data.Also, since the data I'm filling the chart with data stored in a Session variable of type DataSet, Will this variable need to be retrieved and again tied to the Chart during the checkZoom postback?
I also strongly recommend you to read this thread about similar issue.
TeeChart for .NET v3 supports AJAX and can be used in an UpdatePanel to limit any repaints to that page zone alone. TeeChart also offers some specific optimisations using AJAX clientside code to permit scrolling without a return trip to the server and to capture Chart zoom requests.Has the TeeChart ASP.NET library been tested with Microsoft's ASP.NET AJAX extensions?
There are some live examples of that included with the live ASP.NET demo, like the scrolling example, if you'd like a closer look.
Great, thanks! I'll check it out ASAP.I sent a simple example today w/o ajax.
Files are Default.aspx, Default.aspx.cs, config.xml, and DataBaseExample.cs
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rich,
Visual Studio give me this error message:
The type or namespace name 'Database' could not be found (are you missing a using directive or an assembly reference?)
I thought Database may be referring to Microsoft.AnalysisServices.Database but it isn't as using this type produces several other errors of non-existing methods in the type.
Could you please let us know how can we build your project successfully or send us a simple example project we can run "as-is" here?
Thanks in advance.
I've checked your example but I'm not able to build it here. The problem is in this line:I sent a simple example today w/o ajax.
Files are Default.aspx, Default.aspx.cs, config.xml, and DataBaseExample.cs
Code: Select all
private Database db = Database();
The type or namespace name 'Database' could not be found (are you missing a using directive or an assembly reference?)
I thought Database may be referring to Microsoft.AnalysisServices.Database but it isn't as using this type produces several other errors of non-existing methods in the type.
Could you please let us know how can we build your project successfully or send us a simple example project we can run "as-is" here?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
new file
Hi,
I've uploaded a zip file called testforSteema.zip which should compile for you. Of course the database object, which is my own object responsible for communicating with an Oracle database, won't connect for you. However, you can change modify this to work with random data.
NOTE: The graph displays about 12,000 data points.
thanks,
Rich
I've uploaded a zip file called testforSteema.zip which should compile for you. Of course the database object, which is my own object responsible for communicating with an Oracle database, won't connect for you. However, you can change modify this to work with random data.
NOTE: The graph displays about 12,000 data points.
thanks,
Rich
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rich,
Thanks for the example project. I've modified it using random data and worked fine for me here:
Does it work fine at your end? Could you please modify it so that we can reproduce the problem here?
Thanks in advance.
Thanks for the example project. I've modified it using random data and worked fine for me here:
Code: Select all
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
FillChart();
getDetailedData();
}
ChartSession();
CheckZoom(WebChart1);
}
protected void FillChart()
{
Steema.TeeChart.Chart chart1 = WebChart1.Chart;
Steema.TeeChart.Styles.Volume series1 = (Steema.TeeChart.Styles.Volume)chart1.Series[0];
chart1.Tools.Add(new Steema.TeeChart.Tools.ZoomTool());
((Steema.TeeChart.Tools.ZoomTool)chart1.Tools[0]).ZoomPenColor = Color.OliveDrab;
series1.XValues.DateTime = true;
chart1.Axes.Bottom.Labels.DateTimeFormat = "MM/yyyy";
chart1.Axes.Bottom.Labels.MultiLine = true;
chart1.Panel.MarginBottom = 10;
// Legend
Steema.TeeChart.Legend legend = chart1.Legend;
legend.ImageMode = Steema.TeeChart.Drawing.ImageMode.Stretch;
series1.Clear();
series1.DataSource = getSummaryData();
series1.XValues.DataMember = "ARRDATE";
series1.YValues.DataMember = "ARRTIME";
series1.LabelMember = "LABELS";
series1.CheckDataSource();
}
private DataTable getSummaryData()
{
DataTable myData = new DataTable ();
DataColumn ARRDATE = new DataColumn("ARRDATE", Type.GetType("System.DateTime"));
DataColumn ARRTIME = new DataColumn("ARRTIME", Type.GetType("System.Double"));
DataColumn LABELS = new DataColumn("LABELS", Type.GetType("System.String"));
myData.Columns.Add(ARRDATE);
myData.Columns.Add(ARRTIME);
myData.Columns.Add(LABELS);
DataRow dataRow;
DateTime myTime = DateTime.Now;
for (int i = 0; i < 12000; i++)
{
dataRow = myData.NewRow();
dataRow[ARRDATE] = myTime.AddDays(i);
TimeSpan elapsedTime = new TimeSpan(DateTime.Now.Ticks - myTime.Ticks);
dataRow[ARRTIME] = elapsedTime.Ticks;
dataRow[LABELS] = "Point number" + (i + 1).ToString();
myData.Rows.Add(dataRow);
}
return myData;
}
private DataTable getDetailedData()
{
return getSummaryData();
}
protected void ChartSession()
{
Steema.TeeChart.Chart ch1 = WebChart1.Chart;
MemoryStream tmpChart = new MemoryStream();
if (Session["WebChart1"] == null)
{
//export Chart to a MemoryStream template
ch1.Export.Template.Save(tmpChart);
//save template to a Session variable
Session.Add("WebChart1", tmpChart);
}
else
{
//retrieve the session stored Chart
tmpChart = (MemoryStream)Session["WebChart1"];
//set the Stream position to 0 as the last read/write
//will have moved the position to the end of the stream
tmpChart.Position = 0;
//import saved Chart
WebChart1.Chart.Import.Template.Load(tmpChart);
}
}
private void CheckZoom(WebChart wChart)
{
ArrayList zoomedState = (ArrayList)Session[wChart.ID + "Zoomed"];
if (wChart.Chart.Tools.Count > 0)
{
zoomedState = ((Steema.TeeChart.Tools.ZoomTool)wChart.Chart.Tools[0]).SetCurrentZoom(Request,
zoomedState);
if (zoomedState == null)
Session.Remove(wChart.ID + "Zoomed");
else
Session.Add(wChart.ID + "Zoomed", zoomedState);
}
}
}
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Nope
Thanks for looking at it - but it doesn't work here. After a zoom I get no data back.
Could it be file or directory permissions on the workstation I'm using (I do NOT have administrative access on this machine)?
Are you using httphandler?
I'm running it it within the Visual Studio 2005 environment...I don't have priveledges to modify IIS ... could this be a problem? How is the data/graph cached when using httpHandler?
thanks,
Rich
Could it be file or directory permissions on the workstation I'm using (I do NOT have administrative access on this machine)?
Are you using httphandler?
I'm running it it within the Visual Studio 2005 environment...I don't have priveledges to modify IIS ... could this be a problem? How is the data/graph cached when using httpHandler?
thanks,
Rich
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rich,
Yes, I'm using Httphandler. In your prjoect I just modified the sources I posted. Which exact TeeChart for .NET v3 release are you using? Could you please try using the version posted last Friday?
Setting TempChartStyle.Httphandler, the chart is passed as an image in Context.Cache.
Thanks in advance.
Yes, I'm using Httphandler. In your prjoect I just modified the sources I posted. Which exact TeeChart for .NET v3 release are you using? Could you please try using the version posted last Friday?
Setting TempChartStyle.Httphandler, the chart is passed as an image in Context.Cache.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |