Problem in showing more than one marks as text at a point
-
- Newbie
- Posts: 57
- Joined: Mon Nov 19, 2007 12:00 am
Problem in showing more than one marks as text at a point
Hi,
I am using TChart Suface class to draw a 3D surface. Here is code
Surface.Marks.Visible = true;
Surface.Add(x,y,z,numeral);
numeral - as text in function.
On display, this numeral is shown as marks. This way I can display only
a single numeral at a point.
Problem is, how can we show two numerals at a single point having
different formats like color, bold and fonts?
-Raed
I am using TChart Suface class to draw a 3D surface. Here is code
Surface.Marks.Visible = true;
Surface.Add(x,y,z,numeral);
numeral - as text in function.
On display, this numeral is shown as marks. This way I can display only
a single numeral at a point.
Problem is, how can we show two numerals at a single point having
different formats like color, bold and fonts?
-Raed
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Raed,
You can use GetSeriesMark event like this:
You can use GetSeriesMark event like this:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.Surface surface1 = new Steema.TeeChart.Styles.Surface(tChart1.Chart);
Random y = new Random();
int count = 1;
for (int x = 0; x < 10; x++)
{
for (int z = 0; z < 10; z++)
{
surface1.Add(x, y.Next(), z, "point " + count.ToString());
count++;
}
}
surface1.Marks.Visible = true;
surface1.GetSeriesMark += new Steema.TeeChart.Styles.Series.GetSeriesMarkEventHandler(surface1_GetSeriesMark);
}
void surface1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
{
if (e.ValueIndex == 5)
{
e.MarkText = series.Labels[e.ValueIndex - 1] + " - " + series.Labels[e.ValueIndex];
series.Marks.Items[e.ValueIndex].Font.Bold = true;
series.Marks.Items[e.ValueIndex].Font.Color = Color.Red;
series.Marks.Items[e.ValueIndex].Color = Color.White;
}
}
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: 57
- Joined: Mon Nov 19, 2007 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Raed,
I'm afraid this is not possible. I've added your request to our wish-list to be considered for inclusion in future releases.
I'm afraid this is not possible. I've added 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Raed,
As an update, the only solution I can think of now to achieve what you request is setting mark text as you wish, set font color to transparent and then manually draw the text on TeeChart's canvas as shown here:
As an update, the only solution I can think of now to achieve what you request is setting mark text as you wish, set font color to transparent and then manually draw the text on TeeChart's canvas as shown here:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Styles.Surface surface1;
private void InitializeChart()
{
surface1 = new Steema.TeeChart.Styles.Surface(tChart1.Chart);
Random y = new Random();
int count = 1;
for (int x = 0; x < 10; x++)
{
for (int z = 0; z < 10; z++)
{
surface1.Add(x, y.Next(), z, "point " + count.ToString());
count++;
}
}
surface1.Marks.Visible = true;
surface1.Marks.Font.Color = Color.Transparent;
surface1.GetSeriesMark += new Steema.TeeChart.Styles.Series.GetSeriesMarkEventHandler(surface1_GetSeriesMark);
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
g.Font.Color = Color.Red;
g.Font.Size = surface1.Marks.Font.Size;
g.Font.Bold = surface1.Marks.Font.Bold;
Steema.TeeChart.Styles.SeriesMarks.Position mp1 = surface1.Marks.Positions[5];
g.TextOut(mp1.LeftTop.X, mp1.LeftTop.Y + 1, surface1.CalcZPos(5), surface1.Labels[4]);
g.Font.Color = Color.Blue;
g.TextOut(mp1.LeftTop.X + mp1.Width/2, mp1.LeftTop.Y + 1, surface1.CalcZPos(5), surface1.Labels[5]);
}
void surface1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
{
if (e.ValueIndex == 5)
{
e.MarkText = series.Labels[e.ValueIndex - 1] + series.Labels[e.ValueIndex];
}
else
{
e.MarkText = "";
}
}
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: 57
- Joined: Mon Nov 19, 2007 12:00 am
Problem in showing marks label
Hi,
I have uploaded one image which describes the subject line problem.
Please update on it.
Thanks,
Sanyog
I have uploaded one image which describes the subject line problem.
Please update on it.
Thanks,
Sanyog
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Re: Problem in showing marks label
Hello,
I think Narcís understood your problem. As he said, he has entered the issue as a feature request (NOT as a defect). Can you not use the workaround he suggested?
Thank you for you file 3Dplot.BMP.drillright40 wrote:I have uploaded one image which describes the subject line problem.
Please update on it.
I think Narcís understood your problem. As he said, he has entered the issue as a feature request (NOT as a defect). Can you not use the workaround he suggested?
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/
-
- Newbie
- Posts: 57
- Joined: Mon Nov 19, 2007 12:00 am
-
- Newbie
- Posts: 57
- Joined: Mon Nov 19, 2007 12:00 am
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello,
http://www.teechart.net/support/viewtop ... 8&start=30
Thank you for the demonstration. I think I mentioned a possibly complicated workaround to this issue in the last message in this thread:drillright40 wrote: In continuous with previous reply, I have uploaded the src code also.
http://www.teechart.net/support/viewtop ... 8&start=30
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/