Page 1 of 1

Just one simple value

Posted: Thu Mar 31, 2005 12:59 pm
by 6923391
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

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