lable axsis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Alexbb
Newbie
Newbie
Posts: 15
Joined: Mon Jul 09, 2007 12:00 am

lable axsis

Post by Alexbb » Mon Feb 04, 2008 12:35 pm

Hello,
I have q question.
I made 2 (and more) axis on a single chart. each axis has its own graph. All graphs have the same color. U wan to distinguish between graphs.
I want to make a lable on each graph area with its name. How can i do it.
Pls look at the example

|(axsis1)
| graph name
|_____________________

|(axsis2)
| grapsh name
|_______________ ______


Second question:
I plotted 20,000 point. t chart is very slow i use 2005 version for visual studio. How canI make it faster.
Thans Alex

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 Feb 04, 2008 12:58 pm

Hi Alex,

I recommend you to use Annotation tools for that, for example:

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private void InitializeChart()
		{
			line1.FillSampleValues();
			line2.FillSampleValues();

			annotation1.Text = line1.Title;
			annotation2.Text = line2.Title;

			Bitmap bmp = tChart1.Bitmap;
		}

		private void SetAnnotationsPosition()
		{
			annotation1.Shape.CustomPosition = true;
			annotation1.Shape.Left = tChart1.Axes.Left.Position + 5;
			annotation1.Shape.Top = tChart1.Axes.Left.IStartPos + 5;

			annotation2.Shape.CustomPosition = true;
			annotation2.Shape.Left = axis1.Position + 5;
			annotation2.Shape.Top = axis1.IStartPos + 5;
		}

		private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			SetAnnotationsPosition();
		}
Regarding chart's performance, I suggest that you read the Real-Time Charting here and also look at the examples at All Features\Welcome!\Speed in the features demo, available at TeeChart's program group.
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

Alexbb
Newbie
Newbie
Posts: 15
Joined: Mon Jul 09, 2007 12:00 am

another question

Post by Alexbb » Tue Feb 05, 2008 7:49 pm

Hello,
You helped me a lot regarding the text title (annotation tool).
But I have another question. When I resize the tchart form the annotation tool doesn’t keep it position relative to the axis. After resizing i get the annotation tool in different place. How I can keep it always be near the axis no meter if I resize the form.
Looking for your answer
Alex,

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 Feb 06, 2008 8:53 am

Hi Alex,

I'm glad to hear that helped.

To solve this issue you just need to use Resize event with a Bitmap call as shown here:

Code: Select all

		private void tChart1_Resize(object sender, EventArgs e)
		{
			Bitmap bmp = tChart1.Bitmap;
		}
Bitmap method call forces the chart being internally repainted and therefore AfterDraw event being called.
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

Alexbb
Newbie
Newbie
Posts: 15
Joined: Mon Jul 09, 2007 12:00 am

question

Post by Alexbb » Wed Feb 06, 2008 10:11 am

Hi,
I wrote the next piece of code as u said:
private void tChart1_Resize(object sender, EventArgs e)
{
Bitmap bmp = tChart1.Bitmap;
}

but it didn't help me. What I am doing with the "bmp" variable, it is in the air.
How I make the annotation tool to save it position in resizing the form.
Thank you
Alex

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 Feb 06, 2008 10:42 am

Hi Alex,

Code below works fine for me here. You don't need to use bmp variable for anything in particular. You just need it to assign the output or tChart1.Bitmap. Which, as I told you, makes the chart being internally repainted therefore AfterDraw event fired and SetAnnotationsPosition executed.

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private void InitializeChart()
		{
			line1.FillSampleValues();
			line2.FillSampleValues();

			annotation1.Text = line1.Title;
			annotation2.Text = line2.Title;

			Bitmap bmp = tChart1.Bitmap;
		}

		private void SetAnnotationsPosition()
		{
			annotation1.Shape.CustomPosition = true;
			annotation1.Shape.Left = tChart1.Axes.Left.Position + 5;
			annotation1.Shape.Top = tChart1.Axes.Left.IStartPos + 5;

			annotation2.Shape.CustomPosition = true;
			annotation2.Shape.Left = axis1.Position + 5;
			annotation2.Shape.Top = axis1.IStartPos + 5;
		}

		private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			SetAnnotationsPosition();
		}

		private void tChart1_Resize(object sender, EventArgs e)
		{
			Bitmap bmp = tChart1.Bitmap;
		}
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

Alexbb
Newbie
Newbie
Posts: 15
Joined: Mon Jul 09, 2007 12:00 am

new question

Post by Alexbb » Sun Feb 10, 2008 7:00 am

Hello,
Your answer helped me a lot.
Regarding the second problem, when I draw 20,000 points I also used your advice (fast line) and it helped. But when I use "label member" from data source it slows tchart very much.
Is there a way to overcome this problem? Using labels with out the slowing effect.
Thanks,
Alex,

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 Feb 12, 2008 9:29 am

Hi Alex,

Which is the performance differential at the moment? Could you please send us a simple example project we can run "as-is" to reproduce the issue here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
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

Alexbb
Newbie
Newbie
Posts: 15
Joined: Mon Jul 09, 2007 12:00 am

labels problem

Post by Alexbb » Thu Feb 14, 2008 3:44 pm

Hello,
First of all thank you. Secondly I used labels because in the "x" axis I have a time scaling. The "x" axis values are in datatable and are constructed in the next form:

x (axis)
21:08:37:616
21:08:37:666
21:08:37:818
21:08:38:116
21:08:36:268

The problem was that I couldn't find how to make this values to be shown on the "x" axis so i used labels.
Can you tell me what is the code for taking this values on "x" axis. I looked at the demo and it didn't helped me.
Alex,

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

Post by Narcís » Thu Feb 14, 2008 3:55 pm

Hi Alex,

You should set series' XValues to DateTime, for example:

Code: Select all

line1.XValues.DateTime = true; 
Then you should set bottom axis labels DateTimeFormat as described in Tutorial 4 - Axis Control, for example:

Code: Select all

tChart1.Axes.Bottom.Labels.DateTimeFormat = "hh:mm:ss.FFF"; 
You'll find the tutorials at TeeChart's program group. You may also be interested in reading Custom Date and Time Format Strings.
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

Alexbb
Newbie
Newbie
Posts: 15
Joined: Mon Jul 09, 2007 12:00 am

time axsis

Post by Alexbb » Sun Feb 17, 2008 12:21 pm

Hello,
This helped me but I have a small problem.
I can't see the "x" axis labels values. Only if I will do the next command I will see them:

tchart.axsis.bottom.labels.angle=90;

And even in this case I will see the labels only if the form is wide enough.
If the form is small size it is as if there is no place to the labels and tchart doesn’t show them.
Also I need that the labels will be horizontal angle =180 and of cause to see them.
Looking to your answer,
Alex,

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 Feb 18, 2008 10:07 am

Hi Alex,

I can see the bottom axis labels in the project you sent. Anyway, I recommend you to read this thread. It's quite a long thread but almost all posibilities with axes labels are discussed there.

Thanks in advance.
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

Alexbb
Newbie
Newbie
Posts: 15
Joined: Mon Jul 09, 2007 12:00 am

your answer

Post by Alexbb » Tue Feb 19, 2008 5:34 pm

Hello,
I sent you a piece of code few days ago about "x" axis labels that I can see. I Will be very thank full if you will answer me as quick as possible, it is very urgent.
Alex,

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 Feb 20, 2008 8:49 am

Hi Alex,

I'm sorry but I can't find this code. Would you be so kind to remind me of it?

Thanks in advance.
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

Alexbb
Newbie
Newbie
Posts: 15
Joined: Mon Jul 09, 2007 12:00 am

question

Post by Alexbb » Wed Feb 20, 2008 3:58 pm

Hello,
I sent my code on suuport mailbox.
my mail: det_moroz5@yahoo.com

Looking for your answer,
Alex,

Post Reply