Hi,
I have a problem with getting the Minimum and Maximum from WebChart Custom Axes using TeeChart for .NET [06 OCT 2006] RELEASE 2.0.2469.25744/5.
To demonstrate my problem I sent a message to news://www.steema.net/steema.public.attachments
Best regards,
Gabor Varga
WebChart Zooming - Custom Axis
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Gabor,
To zoom with custom axes you need to do something as shown in this FAQs item.
If the problem persists please send us an example we can run "as-is" to reproduce the problem here. As with your code snippet we can't see its context in the application.
To zoom with custom axes you need to do something as shown in this FAQs item.
If the problem persists please send us an example we can run "as-is" to reproduce the problem here. As with your code snippet we can't see its context in the application.
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 |
Hi,
I uploaded a sample ASP.NET Web Application to demonstrate the problem.
(http://www.steema.net/upload/ WebFormSample.zip, Length 1236361)
After starting the application click on the Button labeled "Get Axis minimum, maximum".
Best regards,
Gabor Varga
I uploaded a sample ASP.NET Web Application to demonstrate the problem.
(http://www.steema.net/upload/ WebFormSample.zip, Length 1236361)
After starting the application click on the Button labeled "Get Axis minimum, maximum".
Best regards,
Gabor Varga
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Gabor,
Thanks for the example, we will study the code and get back to you ASAP.
Thanks for the example, we will study the code and get back to you ASAP.
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 Gabor,
Yes, we could reproduce the issue but we are still investigating it. We will get back to you when we have further news.
Yes, we could reproduce the issue but we are still investigating it. We will get back to you when we have further news.
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 Gabor,
We found that a workaround could be using this:
The code above forces the chart being drawn and then zooms it as if the zoomed area was the entire chart. So the full example could be like this:
We found that a workaround could be using this:
Code: Select all
bmp := ch1.Bitmap();
((ZoomTool(ch1.Tools[0])).Zoom(ch1.ChartRect));
Code: Select all
unit WebForm1;
interface
uses
System.Collections, System.ComponentModel,
System.Data, System.Drawing, System.Web, System.Web.SessionState,
System.Web.UI, System.Web.UI.WebControls, System.Web.UI.HtmlControls,
Steema.TeeChart.Web, Borland.VCL.SysUtils, Steema.TeeChart.Styles,
Steema.TeeChart, System.IO, Steema.TeeChart.Tools;
type
TWebForm1 = class(System.Web.UI.Page)
{$REGION 'Designer Managed Code'}
strict private
procedure InitializeComponent;
procedure Button1_Click(sender: System.Object; e: System.EventArgs);
{$ENDREGION}
strict private
procedure Page_Load(sender: System.Object; e: System.EventArgs);
strict protected
WebChart1: Steema.TeeChart.Web.WebChart;
Button1: System.Web.UI.WebControls.Button;
Label1: System.Web.UI.WebControls.Label;
Label2: System.Web.UI.WebControls.Label;
procedure OnInit(e: EventArgs); override;
private
{ Private Declarations }
procedure CheckZoom(wChart: WebChart);
procedure UpdateLabels;
public
{ Public Declarations }
end;
implementation
{$REGION 'Designer Managed Code'}
/// <summary>
/// Required method for Designer support -- do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure TWebForm1.InitializeComponent;
begin
Include(Self.Button1.Click, Self.Button1_Click);
Include(Self.Load, Self.Page_Load);
end;
{$ENDREGION}
procedure TWebForm1.Page_Load(sender: System.Object; e: System.EventArgs);
var
line1: Line;
ch1 : Steema.TeeChart.Chart;
tmpChart : MemoryStream;
bmp: Bitmap;
begin
ch1 := WebChart1.Chart;
if (Session['ch1'] = nil) then
begin
line1 := Line.Create;
ch1.Series.Add(line1);
line1.FillSampleValues;
tmpChart := MemoryStream.Create;
//export Chart to a MemoryStream template
ch1.Export.Template.Save(tmpChart);
Session['ch1'] := tmpChart;
end
else
begin
//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
ch1.Import.Template.Load(tmpChart);
end;
CheckZoom(WebChart1);
//Workaround to force axes having valid values
bmp := ch1.Bitmap();
((ZoomTool(ch1.Tools[0])).Zoom(ch1.ChartRect));
UpdateLabels;
end;
procedure TWebForm1.CheckZoom(wChart: WebChart);
var zoomedState: ArrayList;
begin
zoomedState := (ArrayList(Session[(wChart.ID + 'Zoomed')]));
zoomedState := (ZoomTool(wChart.Chart.Tools[0])).SetCurrentZoom(Request,
zoomedState);
if (zoomedState = nil) then
Session.Remove((wChart.ID + 'Zoomed'))
else
Session.Add((wChart.ID + 'Zoomed'), zoomedState);
end;
procedure TWebForm1.UpdateLabels;
begin
Label1.Text := WebChart1.Chart.Axes.Left.Minimum.ToString;
Label2.Text := WebChart1.Chart.Axes.Left.Maximum.ToString;
end;
procedure TWebForm1.OnInit(e: EventArgs);
var zoomTool1: Steema.TeeChart.Tools.ZoomTool;
begin
//
// Required for Designer support
//
InitializeComponent;
zoomTool1:=ZoomTool.Create(WebChart1.Chart);
inherited OnInit(e);
end;
procedure TWebForm1.Button1_Click(sender: System.Object; e: System.EventArgs);
begin
UpdateLabels;
end;
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 |