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.
What does mean DeterminePostBackMode
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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?
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi scott,
Does that example work fine at your end? Does it behave as you expect?
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 |
Instructions - How to post in this forum |
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();
}
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();
}
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi scott,
In that case you could implement button's code like below. Setting axes to automatic you unzoom the chart.
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 |
Instructions - How to post in this forum |