Page 1 of 2
lable axsis
Posted: Mon Feb 04, 2008 12:35 pm
by 13046028
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
Posted: Mon Feb 04, 2008 12:58 pm
by narcis
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.
another question
Posted: Tue Feb 05, 2008 7:49 pm
by 13046028
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,
Posted: Wed Feb 06, 2008 8:53 am
by narcis
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.
question
Posted: Wed Feb 06, 2008 10:11 am
by 13046028
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
Posted: Wed Feb 06, 2008 10:42 am
by narcis
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;
}
new question
Posted: Sun Feb 10, 2008 7:00 am
by 13046028
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,
Posted: Tue Feb 12, 2008 9:29 am
by narcis
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.
labels problem
Posted: Thu Feb 14, 2008 3:44 pm
by 13046028
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,
Posted: Thu Feb 14, 2008 3:55 pm
by narcis
Hi Alex,
You should set series' XValues to DateTime, for example:
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.
time axsis
Posted: Sun Feb 17, 2008 12:21 pm
by 13046028
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,
Posted: Mon Feb 18, 2008 10:07 am
by narcis
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.
your answer
Posted: Tue Feb 19, 2008 5:34 pm
by 13046028
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,
Posted: Wed Feb 20, 2008 8:49 am
by narcis
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.
question
Posted: Wed Feb 20, 2008 3:58 pm
by 13046028
Hello,
I sent my code on suuport mailbox.
my mail:
det_moroz5@yahoo.com
Looking for your answer,
Alex,