Wrong axis in the marks

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
MMP
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Sweden
Contact:

Wrong axis in the marks

Post by MMP » Thu Aug 19, 2004 2:25 pm

1) My x-axis consists of strings and my y axis of doubles. When I turn on the visibility of the marks, they contain the string labels in the X-axis instead of the value on the y-axis.

2) The values in the Y-axis have up to 3 decimals. Can I reduce the value shown in the markes to one decimal, without changing the value of the actual point in the chart? (I hope you figure out what I mean... :) )

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Fri Aug 20, 2004 11:31 am

Hi --
1) My x-axis consists of strings and my y axis of doubles. When I turn on the visibility of the marks, they contain the string labels in the X-axis instead of the value on the y-axis.
Try:

Code: Select all

tChart1.Series[0].Marks.Style = Steema.TeeChart.Styles.MarksStyles.Value;
2) The values in the Y-axis have up to 3 decimals. Can I reduce the value shown in the markes to one decimal, without changing the value of the actual point in the chart? (I hope you figure out what I mean... )
How about:

Code: Select all

private void Form1_Load(object sender, System.EventArgs e) {
	Random rnd = new Random();
	for(int i=0;i<10;++i) {
		line1.Add(Convert.ToDouble(i), rnd.NextDouble() / 3, Convert.ToChar(65 + i).ToString());
	}
	line1.ValueFormat = "";
	line1.Marks.Visible = true;
	line1.Marks.Style = Steema.TeeChart.Styles.MarksStyles.Value;
}

private void line1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e) {
	e.MarkText = Convert.ToString(Math.Round(Convert.ToDouble(e.MarkText), 3));
}
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/

MMP
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Sweden
Contact:

Post by MMP » Fri Aug 20, 2004 1:00 pm

Worked perfect!

Post Reply