Page 1 of 1
display Multiple Charts?
Posted: Mon May 07, 2007 2:36 am
by 9644278
how to do display multiple charts in on teechart
like this
http://demo.q139.cn/Code/Java/Chart/JFr ... tDemo3.htm
Posted: Mon May 07, 2007 10:14 am
by 9348258
Hi Grace
You can use a Custom Axis to display multiple charts, I have done a simple example to show you how do this.
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
tChart1.Aspect.View3D = false;
tChart1.Panel.Gradient.Visible = true;
tChart1.Panel.Gradient.UseMiddle = true;
tChart1.Panel.Gradient.EndColor = Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
tChart1.Panel.Gradient.MiddleColor = Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
tChart1.Panel.Gradient.StartColor = Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Steema.TeeChart.Styles.Area area1 = new Steema.TeeChart.Styles.Area(tChart1.Chart);
Axis bottomAxis = tChart1.Axes.Bottom;
bottomAxis.StartPosition = 0;
bottomAxis.EndPosition = 30;
bottomAxis.AxisPen.Color = Color.Red;
bottomAxis.Title.Font.Color = Color.Red;
Axis axis1 = new Axis(true, false, tChart1.Chart);
tChart1.Axes.Custom.Add(axis1);
line2.CustomHorizAxis = axis1;
axis1.StartPosition = 35;
axis1.EndPosition = 65;
axis1.AxisPen.Color = Color.Green;
axis1.Title.Font.Color = Color.Green;
Axis axis2 = new Axis(true, false, tChart1.Chart);
tChart1.Axes.Custom.Add(axis2);
area1.CustomHorizAxis = axis2;
axis2.StartPosition = 70;
axis2.EndPosition = 100;
axis2.AxisPen.Color = Color.Yellow;
axis1.Title.Font.Color = Color.Yellow;
line1.FillSampleValues();
line2.FillSampleValues();
area1.FillSampleValues();
ColorBand colorband1 = new ColorBand(tChart1.Chart);
colorband1.Active = true;
colorband1.Pen.Visible = false;
colorband1.Axis = tChart1.Axes.Bottom;
colorband1.Transparency = 40;
colorband1.Start = 0;
colorband1.End = 31;
colorband1.DrawBehind = false;
ColorBand colorband2 = new ColorBand(tChart1.Chart);
colorband2.Active = true;
colorband2.Pen.Visible = false;
colorband2.Axis = axis1;
colorband2.Transparency = 40;
colorband2.Start = 0;
colorband2.End = 31;
colorband2.DrawBehind = false;
ColorBand colorband3 = new ColorBand(tChart1.Chart);
colorband3.Active = true;
colorband3.Pen.Visible = false;
colorband3.Axis = axis2;
colorband3.Transparency = 40;
colorband3.Start = 0;
colorband3.End = 31;
colorband3.DrawBehind = false;
}
Version 3 will include subchart tool. This may be an alternative on how to achieve the kind of chart you are asking for.
Posted: Wed May 09, 2007 5:59 am
by 9644278
thank you very much