Just one simple value

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:

Just one simple value

Post by MMP » Thu Mar 31, 2005 12:59 pm

I have one single value on a chart that looks like this:
Image

But I want it to look like this:
Image

I dont need a scale on the X-axis, since I only have one single value, but I want the line to run over the entire chart.
The Y-axis should have different scale depending on the value och the line.

Thank you,
Mathias
MMP

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 Mar 31, 2005 1:41 pm

Hi Mathias,

You have several options for this:

1) Adding two points for the line.

2) Using Null points.

2) Drawing a line in the canvas.

3) Using ColorLine tool to draw the line as:

Code: Select all

		private void Form1_Load(object sender, System.EventArgs e)
		{
			int Const;
            			
			Const=111;

			Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);

			line1.Add(Const);

			Steema.TeeChart.Tools.ColorLine colorLine1 = new Steema.TeeChart.Tools.ColorLine(tChart1.Chart);

			colorLine1.Active = true; 
			colorLine1.AllowDrag = false;
			colorLine1.Axis = tChart1.Axes.Left;
			colorLine1.Pen.Color = line1.Color;
			colorLine1.Value = Const;

			tChart1.Aspect.View3D=false;
			tChart1.Legend.Visible=false;

			tChart1.Axes.Left.SetMinMax(0,Const+50);			
		}
Regarding the left (Y) axis it scales authomatically by default or use SetMinMax as in the example above. For the bottom axis (X) you can make it invisible as in the code above
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

Post Reply