Page 1 of 1

Shape_Click() events

Posted: Tue Dec 02, 2003 2:21 pm
by 8120359
I have a problem to get Click-event to work when creating shape series dynamically. When I'm using editor to create new one, then shape_Click - event works.

Here's the sample code, any ideas?


public class Form2 : System.Windows.Forms.Form
{

private Steema.TeeChart.Styles.Shape shape;
.
.
.


// create new shape
private void button2_Click(object sender, System.EventArgs e)
{

shape = new Steema.TeeChart.Styles.Shape();
tChart1.Series.Add(shape);

shape.X0 = 4;
shape.X1 = 9;
shape.Y0 = 5;
shape.Y1 = 12;
shape.Style = Steema.TeeChart.Styles.ShapeStyles.Rectangle;
shape.Transparent=false;
shape.Pen.Color=Color.Blue;
shape.Pen.Width=2;
shape.Brush.Color=Color.Blue;
shape.Font.Size=1;
shape.Click += new System.Windows.Forms.MouseEventHandler(this.shape_Click);
}

public void shape_Click(object sender, System.Windows.Forms.MouseEventArgs e)
{
MessageBox.Show("Shape clicked");
}

Posted: Tue Dec 02, 2003 2:49 pm
by Pep
Yes, this is a known bug (already added on our defect list), it sonly happens using the Rectanlgle style. We'll try to fix if for the next maintenance releases.

Josep Lluis Jorge
http://support.steema.com

Posted: Thu Dec 18, 2003 6:44 pm
by 8122923
Hello,

Does it mean that every runtime interactive events that respond to user mouseclicks will not work in TeeChart Pro.NET ?

My WebChart is PostBack.
I tried to make events with mouse, like ClickBackground, ClickSeries, ClickTitle. The mouse cursor is a hand (means there is a link).
My WebChart is printed and filled with data in it but when I click, I just get a postback (refresh browser) with same data. My events are simple :

private void WebChart1_ClickTitle(object sender, System.Web.UI.ImageClickEventArgs e)
{
txtMessage.Text = "Test!";
}

I know that the program doesn't enter in this function (I set breakpoint).

Is it normal that events don't work or there is something I missed ?


Thank you,
Simon

Posted: Tue Jan 13, 2004 4:00 pm
by Chris
Hi Simon,

Have you tried running the ASP.NET example under:
C:\Program Files\Steema Software\TeeChart for .NET v1\TeeChartForNET\WebForm ?

Try creating a C# ASP.NET project on your machine and copying all the *.aspx.* files across to it.

Now change part of the Page_Load() method so it looks like this:

Code: Select all

//setup Chart
if (ch1.Series.Count<2)
{ 
  ch1.Series.Add(new Steema.TeeChart.Styles.Points());
  ch1.Series.Add(new Steema.TeeChart.Styles.Shape());
}
ch1.Header.Text="Chart 1. Click on Points of this Chart to see event demo.";
		
ch1.Series[0].FillSampleValues(5);
ch1.Series[1].FillSampleValues(1);
Now cut the following line from the InitializeComponent() method:

Code: Select all

this.WebChart1.ClickSeries += new Steema.TeeChart.Web.WebChart.SeriesEventHandler(this.WebChart1_ClickSeries);
And paste it into the beginning of the Page_Load function ... this seems to work OK here. Does it work OK at your end?

Posted: Mon Jan 19, 2004 3:58 pm
by 8122923
Ok, it didnt work in the previous version, but now, with the patch, it works! Thank for your help.