What does mean DeterminePostBackMode

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
scott
Newbie
Newbie
Posts: 13
Joined: Fri Mar 09, 2007 12:00 am

What does mean DeterminePostBackMode

Post by scott » Mon Apr 16, 2007 1:40 am

There is a onhelp SetCurrentZoom method.
This is the sample code.

private void Page_Load(object sender, System.EventArgs e)
{
MemoryStream tmpChart;

if (Session["ch1"]==null)
{
WebChart1.Chart[0].FillSampleValues();
tmpChart=new MemoryStream();
WebChart1.Chart.Export.Template.Save(tmpChart);
//save template to a Session variable
Session.Add("ch1",tmpChart);
}
else
{
//retrieve the session stored Chart
tmpChart=(MemoryStream)Session["ch1"];
//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);
CheckZoom(WebChart1);
}
}

private void CheckZoom(WebChart wChart)
{
ArrayList zoomedState=(ArrayList)Session[wChart.ID+"Zoomed"];
zoomedState=((Steema.TeeChart.Tools.ZoomTool)wChart.Chart.Tools[0]).SetCurrentZoom(Request,zoomedState,DeterminePostBackMode());
if (zoomedState==null)
Session.Remove(wChart.ID+"Zoomed");
else
Session.Add(wChart.ID+"Zoomed",zoomedState);
}

But when I use this code, nothing happen.
It could not zoom in postback and !postback.
How can I use this code in my program?
Thank you.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Apr 16, 2007 11:12 am

Hi scott,

You should do exactly as shown in the example at the ASP.NET demo included with TeeChart's installation. You can find the demo at C:\Program Files\Steema Software\TeeChart for .NET v2\TeeChartForNET (Default English installation path). Does this demo work fine at your end?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

scott
Newbie
Newbie
Posts: 13
Joined: Fri Mar 09, 2007 12:00 am

Post by scott » Tue Apr 17, 2007 4:51 am

Thank you Narcís,
I knew there is a Zoom sample in file WebAppZoomChart.aspx.
But I can't find any thing about DeterminePostBackModebout int WebAppZoomChart.aspx.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Apr 17, 2007 10:25 am

Hi scott,

Does that example work fine at your end? Does it behave as you expect?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

scott
Newbie
Newbie
Posts: 13
Joined: Fri Mar 09, 2007 12:00 am

Post by scott » Wed Apr 18, 2007 1:03 am

Please see the step
1.Web page load
2.Zoom the WebChart
3.Click Button1 the WebChrt.Series[0] will change value, but WebChart still in the step 2 zoom scale.

My problem is when I already zoomed a webchart, then I update webchart data.
But the webchart still in last zoom scale.
When I update webchart data, I try to use Chart.Zoom.Undo but it still can't back normal zoom.

protected void Page_Load(object sender, EventArgs e)
{
MemoryStream tmpChart;

WebChart1.Chart.Series[0].FillSampleValues(200);
if (Session["ch1"] == null)
{
WebChart1.Chart[0].FillSampleValues();
tmpChart = new MemoryStream();
WebChart1.Chart.Export.Template.Save(tmpChart);
//save template to a Session variable
Session.Add("ch1", tmpChart);
}
else
{
//retrieve the session stored Chart
tmpChart = (MemoryStream)Session["ch1"];
//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);
CheckZoom(WebChart1);
}

}

private void CheckZoom(WebChart wChart)
{
ArrayList zoomedState = (ArrayList)Session[wChart.ID + "Zoomed"];
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);
}

protected void Button1_Click(object sender, EventArgs e)
{
//WebChart1.Chart.Zoom.Undo(); --> I try to use Zoom.Undo()
WebChart1.Chart[0].FillSampleValues();
}

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Apr 18, 2007 8:03 am

Hi scott,

In that case you could implement button's code like below. Setting axes to automatic you unzoom the chart.

Code: Select all

	protected void Button1_Click(object sender, EventArgs e)
	{
		WebChart1.Chart.Axes.Left.Automatic = true;
		WebChart1.Chart.Axes.Bottom.Automatic = true;

		WebChart1.Chart[0].FillSampleValues(); 
	}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

scott
Newbie
Newbie
Posts: 13
Joined: Fri Mar 09, 2007 12:00 am

Post by scott » Wed Apr 18, 2007 8:50 am

Narcís, thank you very much. It really helps me.

I stuck this function a little time.

The resolve is so easy. :roll:

I need to study in TeeChart. And it is a good 'Object'.

Post Reply