Webform Calendar
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am
Webform Calendar
Trying to get a calendar to work on webform with the following code:-
Steema.TeeChart.Styles.Calendar cal = new Steema.TeeChart.Styles.Calendar(this.WebChart1.Chart)
Getting error:-
Object reference not set to an instance of an object.
But I can use the following to make a bar graph work:-
Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(this.WebChart1.Chart)
I am missing something, can you get a calendar to work on a webform, the demo is showing windows form.
Steema.TeeChart.Styles.Calendar cal = new Steema.TeeChart.Styles.Calendar(this.WebChart1.Chart)
Getting error:-
Object reference not set to an instance of an object.
But I can use the following to make a bar graph work:-
Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(this.WebChart1.Chart)
I am missing something, can you get a calendar to work on a webform, the demo is showing windows form.
Hi MikeTheLad
Which TeeChart version are you using? Here It's working fine using lastest release (Build 3.2.2763.26081/2 "available at the web") and the below code:
Could you please try with the last version?
Which TeeChart version are you using? Here It's working fine using lastest release (Build 3.2.2763.26081/2 "available at the web") and the below code:
Code: Select all
Steema.TeeChart.Styles.Calendar calendar1 = new Steema.TeeChart.Styles.Calendar(this.WebChart1.Chart);
(WebChart1.Chart.Series[0] as Steema.TeeChart.Styles.Calendar).FillSampleValues();
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MikeTheLad,
Yes, you are right, this is a bug in v1 but works fine like this:
Yes, you are right, this is a bug in v1 but works fine like this:
Code: Select all
Steema.TeeChart.Styles.Calendar calendar1 = new Steema.TeeChart.Styles.Calendar();
WebChart1.Chart.Series.Add(calendar1);
WebChart1.Chart.Series[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 |
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MikeTheLad,
You can draw text in a calendar cell using something like the code below using RectCell(Column, Row) method.
You can draw text in a calendar cell using something like the code below using RectCell(Column, Row) method.
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
Steema.TeeChart.Styles.Calendar calendar1 = new Steema.TeeChart.Styles.Calendar();
WebChart1.Chart.Series.Add(calendar1);
calendar1.FillSampleValues();
}
protected void WebChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
Steema.TeeChart.Styles.Calendar calendar1 = ((Steema.TeeChart.Styles.Calendar)WebChart1.Chart[0]);
System.Drawing.Rectangle Rect = calendar1.RectCell(2, 5);
}
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 |
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MikeTheLad,
You need to assign the WebChart's AfterDraw event at design-time or at run-time like this:
You need to assign the WebChart's AfterDraw event at design-time or at run-time like this:
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
Steema.TeeChart.Styles.Calendar calendar1 = new Steema.TeeChart.Styles.Calendar();
WebChart1.Chart.Series.Add(calendar1);
calendar1.FillSampleValues();
//AfterDraw event definition
WebChart1.AfterDraw+=new Steema.TeeChart.PaintChartEventHandler(WebChart1_AfterDraw);
}
protected void WebChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
Steema.TeeChart.Styles.Calendar calendar1 = ((Steema.TeeChart.Styles.Calendar)WebChart1.Chart[0]);
System.Drawing.Rectangle Rect = calendar1.RectCell(2, 5);
}
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 |
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MikeTheLad,
Sorry, my fault. AfterDraw event should be as shown below. Removing unnecessary code I removed more than I should.
Sorry, my fault. AfterDraw event should be as shown below. Removing unnecessary code I removed more than I should.
Code: Select all
protected void WebChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
Steema.TeeChart.Styles.Calendar calendar1 = ((Steema.TeeChart.Styles.Calendar)WebChart1.Chart[0]);
System.Drawing.Rectangle Rect = calendar1.RectCell(2, 5);
g.TextOut(Rect.Left, Rect.Top, "My Text");
}
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 |
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MikeTheLad,
There are DayOneColumn and DayOneRow properties which may help you identify the cells.
There are DayOneColumn and DayOneRow properties which may help you identify the cells.
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 |
-
- Newbie
- Posts: 11
- Joined: Mon Jan 19, 2004 5:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MikeTheLad,
TeeChart for .NET v2 and v3 include HotSpots tool for that but I'm afraid this won't work fine with Calendar series. Anyway, I'll add your request to our wish-list to be considered for inclusion in future releases.
TeeChart for .NET v2 and v3 include HotSpots tool for that but I'm afraid this won't work fine with Calendar series. Anyway, I'll add your request to our wish-list to be considered for inclusion in future releases.
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 |
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am