Questions
Questions
Hi,
Q1.: I would like use the same Legend style with area style series as with line style series (a small line with LinePen.Color and a Pointer).
--[]-- line1
--[]-- area1 <--- that's what I want
--()-- line2
How can I do that?
Q2: When I set Pointer.Brush.Color there is no effect, the pointer always have a same color as a Line. How can I use a different Pointer color? (for example: a green line with red pointers)
Thanks in advance,
Gabor Varga
Q1.: I would like use the same Legend style with area style series as with line style series (a small line with LinePen.Color and a Pointer).
--[]-- line1
--[]-- area1 <--- that's what I want
--()-- line2
How can I do that?
Q2: When I set Pointer.Brush.Color there is no effect, the pointer always have a same color as a Line. How can I use a different Pointer color? (for example: a green line with red pointers)
Thanks in advance,
Gabor Varga
Hi,
Q3: I want to use MarkTips to show the Series name when the user move the cursor over the serie. I set the Chart Style of the Legend to Series Names and the MarkTips Style to Legend but it shows only the value of the Series.
What is the correct method to show what I want?
Q4: I have a DateTime Bottom axis and I set the following:
But I see no effect when I set Separation, Increment, RoundFirstLabel...
How can I show Label on axis Minimum and Maximum, and how can I set axis Increment?
Thanks in advance,
Gabor Varga
Q3: I want to use MarkTips to show the Series name when the user move the cursor over the serie. I set the Chart Style of the Legend to Series Names and the MarkTips Style to Legend but it shows only the value of the Series.
What is the correct method to show what I want?
Q4: I have a DateTime Bottom axis and I set the following:
Code: Select all
with MyChart.Axes.Bottom do
begin
Labels.DateTimeFormat := 'yyyy.MM.dd HH:mm:ss';
Labels.MultiLine := true;
Labels.Separation := 0;
Labels.ExactDateTime := True;
Increment := Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneHour);
LabelsOnAxis := True;
Labels.RoundFirstLabel := False;
end;
How can I show Label on axis Minimum and Maximum, and how can I set axis Increment?
Thanks in advance,
Gabor Varga
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello Gabor,
Try setting the pointer of the area series to true:Q1.: I would like use the same Legend style with area style series as with line style series (a small line with LinePen.Color and a Pointer).
Code: Select all
area1.Pointer.Visible = true;
I've been able to reproduce this issue and have fixed it for the next maintenance release which is due to be released in early September.Q2: When I set Pointer.Brush.Color there is no effect, the pointer always have a same color as a Line. How can I use a different Pointer color? (for example: a green line with red pointers)
Try using an annotation tool in conjunction with the mousemove event, e.g.Q3: I want to use MarkTips to show the Series name when the user move the cursor over the serie. I set the Chart Style of the Legend to Series Names and the MarkTips Style to Legend but it shows only the value of the Series.
Code: Select all
private void tChart1_MouseMove(object sender, MouseEventArgs e)
{
int series1 = line1.Clicked(e.X, e.Y);
int series2 = line2.Clicked(e.X, e.Y);
int series3 = area1.Clicked(e.X, e.Y);
anno1.Shape.CustomPosition = true;
anno1.Left = e.X;
anno1.Top = e.Y;
if (series1 != -1)
{
anno1.Active = true;
anno1.Text = "Line1";
}
else if (series2 != -1)
{
anno1.Active = true;
anno1.Text = "Line2";
}
else if (series3 != -1)
{
anno1.Active = true;
anno1.Text = "Area1";
}
else
{
anno1.Active = false;
}
}
The increment works ok with the following code:Q4: I have a DateTime Bottom axis and I set the following:
Code: Select all
private void InitializeChart()
{
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
DateTime now = DateTime.Now;
Random rnd = new Random();
int length = 10;
for (int i = 0; i < length; i++)
{
now = now.AddMinutes(10);
line1.Add(now, rnd.NextDouble());
}
tChart1.Axes.Bottom.Labels.DateTimeFormat = "yyyy.MM.dd HH:mm:ss";
tChart1.Axes.Bottom.Labels.MultiLine = true;
tChart1.Axes.Bottom.Increment = ((1.0 / 24.0) / 60.0) * 20.0; //Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.FifteenMinutes);
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Hello Christopher,
Thanks for you reply, I tried what you suggest but I have some comments:
Q1: OK, Pointer works fine, but the color of the line in Legend is not the Linepen.Color. (In our application all series are Lines, for us Area is a special Line which have filled area.)
Q4: Try to increment length variable from 10 to 1000. Bottom label Increment comes to daily, no label at minimum and maximum.
Best regards,
Gabor Varga
Thanks for you reply, I tried what you suggest but I have some comments:
Q1: OK, Pointer works fine, but the color of the line in Legend is not the Linepen.Color. (In our application all series are Lines, for us Area is a special Line which have filled area.)
Q4: Try to increment length variable from 10 to 1000. Bottom label Increment comes to daily, no label at minimum and maximum.
Best regards,
Gabor Varga
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello,
I'm sorry, but I'm a little confused as to the code you could be using. Would you be so kind as to send me a little code snippet that I could run to see what you mean?Q1: OK, Pointer works fine, but the color of the line in Legend is not the Linepen.Color. (In our application all series are Lines, for us Area is a special Line which have filled area.)
Yes, this is because there are too many labels to be shown at the specified increment and therefore the chart automatically changes it.Q4: Try to increment length variable from 10 to 1000. Bottom label Increment comes to daily, no label at minimum and maximum.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Hi,
Q1: Add a Line and an Area to the TChart.
Set Border of the Area with the following properties:
Visible,
Style : Solid,
Color : Yellow
Width : 5
(In Editor: Series / Format / Border...)
In Legend you will see a the following:
----- line1 (a red line with "line1" caption)
[] area1 (a green rectangle with "area1" caption)
But I want to see the following
----- line1 (a red line with "line1" caption)
=== area1 (a 5 points width yellow line with caption "area1")
Q4: How can I force to show label at the Minimum and at the Maximum of the Axis? (And how can I force to show all Labels?)
Thanks,
Gabor Varga
Q1: Add a Line and an Area to the TChart.
Set Border of the Area with the following properties:
Visible,
Style : Solid,
Color : Yellow
Width : 5
(In Editor: Series / Format / Border...)
In Legend you will see a the following:
----- line1 (a red line with "line1" caption)
[] area1 (a green rectangle with "area1" caption)
But I want to see the following
----- line1 (a red line with "line1" caption)
=== area1 (a 5 points width yellow line with caption "area1")
Q4: How can I force to show label at the Minimum and at the Maximum of the Axis? (And how can I force to show all Labels?)
Thanks,
Gabor Varga
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello,
As for choosing which labels to display, you might want to have a look at the tutorials and specifically the tutorials on axes where it talks about the GetNextAxisLabel event.
OK. You could always try something like the following. Changing the shape of the Legend symbol is not going to be possible any other way at the moment.Q1: Add a Line and an Area to the TChart.
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
tChart1.Series.Add(new Steema.TeeChart.Styles.Line());
tChart1.Series.Add(new Steema.TeeChart.Styles.Area());
tChart1.Series.Add(new Steema.TeeChart.Styles.Line());
tChart1[1].ShowInLegend = false;
tChart1[2].Title = "area1";
tChart1[0].FillSampleValues();
tChart1[1].FillSampleValues();
(tChart1[2] as Line).LinePen.Width = 5;
for (int i = 0; i < tChart1[1].Count; ++i)
{
tChart1[2].Add(tChart1.Series[1].XValues[i], tChart1.Series[1].YValues[i]);
}
}
Setting the separation to zero will force all labels to draw if tchart thinks it can draw them all, however, it will not draw them all if it considers that doing so would produce an unreadable chart.Q4: How can I force to show label at the Minimum and at the Maximum of the Axis? (And how can I force to show all Labels?)
As for choosing which labels to display, you might want to have a look at the tutorials and specifically the tutorials on axes where it talks about the GetNextAxisLabel event.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello,
A quick and dirty way of doing this would be to add in your datatime values as labels, e.g.As for choosing which labels to display, you might want to have a look at the tutorials and specifically the tutorials on axes where it talks about the GetNextAxisLabel event.
Code: Select all
private void InitializeChart()
{
int length = 10;
DateTime now = DateTime.Now;
Random rnd = new Random();
tChart1.Axes.Bottom.Labels.DateTimeFormat = "hh:mm";
for (int i = 0; i < length; i++)
{
line1.Add(now, rnd.NextDouble(), now.ToString(tChart1.Axes.Bottom.Labels.DateTimeFormat));
now = now.AddHours(1);
}
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello,
Sure, you can use:
Sure, you can use:
Code: Select all
private void tChart1_ClickLegend(object sender, MouseEventArgs e)
{
line2.Active = line1.Active;
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/