Page 1 of 1

Basic problem

Posted: Tue Jan 11, 2005 8:41 am
by 9080952
Hi,

I just downloaded the .NET evaluation version, and tried an example with bars from the tutorial, but for some reason, I only see my form with a TeeChart component on it (TeeChart comp. dragged to my form in design mode), but no axes and no bars.

Maybe I forgot to set the visiblitiy for the axis or series or some other basic fault ????

Form code:
using System;

namespace GraphServer
{
/// <summary>
/// Summary description for Test.
/// </summary>
public class Test
{
public Test()
{
//
// TODO: Add constructor logic here
//
}
public static void Main()
{
Form1 form = new Form1();

form.ShowDialog();
}
}
}

For the Form load event next code is provided (from tutorial):
private void Form1_Load(object sender, System.EventArgs e)
{
Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar();
Random rnd = new Random();
Steema.TeeChart.Axis leftAxis = tChart1.Axes.Left;
tChart1.Aspect.View3D = false;
bar1.Marks.Visible = false;
for(int i = 0; i <= 100; ++i)
bar1.Add(rnd.Next(100) * i);

leftAxis.LogarithmicBase = 10;
leftAxis.Logarithmic = true;
leftAxis.SetMinMax(0, 10000);
leftAxis.Labels.ValueFormat = "#e+0";

Steema.TeeChart.Axis bottomAxis = tChart1.Axes.Bottom;
bottomAxis.AutomaticMaximum = true;
bottomAxis.AutomaticMinimum = true;

tChart1.Show();
}


Could you tell me why the axes and bars are missing on my screen ?

Thanks a lot !
Antoon Koster
WL|Delft Hydraulics
Netherlands

Posted: Tue Jan 11, 2005 8:50 am
by Marjan
Hi.

I think the problem is series is not connected to chart (so it cannot be shown on it). In your case, add the following line of code

Code: Select all

bar1.Chart = tChart1.Chart;
// OR ALTERNATIVELY, call the tChart1.Series.Add method
// tChart1.Series.Add(bar1);

Posted: Tue Jan 11, 2005 8:57 am
by 9080952
Yeah ... Thanks.

Antoon Koster