Greetings
With the custom axis is there anything in TChart I can use to mark the horizontal boundaries of say the top of the axis and the bottomof the axis ... currently I was using colorlines .. but I had to draw them programatically and the constantly rescaling axis was makign this a nightmare ... (I add and remove custom axis like its going out of fashion)
The built in Axis have wall settings ... is there something like this for custom axes .. or anything that can mark the top and bottom of a custom axis and stay in place without me having to recalculate ..
Cheers Phil.
Custom Axis marking the top and bottom.
Custom Axis marking the top and bottom.
--------------------
Cheers Phil.
Cheers Phil.
Re: Custom Axis marking the top and bottom.
Hello Phil,
I have made simple example that I think you can use in your application:
Could you please, tell us if previous code works fine for you?
I hope will helps.
Thanks,
I have made simple example that I think you can use in your application:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Axis axis1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Line series1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Steema.TeeChart.Styles.Line series2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
series1.FillSampleValues();
series2.FillSampleValues();
//Add Custom Axes.
axis1 = new Steema.TeeChart.Axis(tChart1.Chart);
tChart1.Axes.Custom.Add(axis1);
series1.CustomVertAxis = tChart1.Axes.Left;
series2.CustomVertAxis = axis1;
tChart1.Axes.Left.StartPosition = 50;
tChart1.Axes.Left.EndPosition = 100;
axis1.StartPosition= 0;
axis1.EndPosition = 50;
axis1.AxisPen.Color = Color.Blue;
axis1.SetMinMax(series2.YValues.Minimum,series2.YValues.Maximum);
tChart1.Axes.Left.SetMinMax(series1.YValues.Minimum, series1.YValues.Maximum);
tChart1.AfterDraw = new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
int pos1 =(int) Math.Abs(tChart1.Axes.Left.StartPosition - axis1.StartPosition);
g.HorizontalLine(pos1,(int) tChart1.Axes.Bottom.CalcXPosValue(tChart1.Axes.Bottom.Maximum),axis1.CalcYPosValue(axis1.Minimum));
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: Custom Axis marking the top and bottom.
Thanks Sandra,
that worked pretty well ...
that worked pretty well ...
--------------------
Cheers Phil.
Cheers Phil.