Basic problem

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Anthony
Newbie
Newbie
Posts: 35
Joined: Wed Feb 25, 2004 5:00 am
Location: WL| Delft Hydraulics, Holland
Contact:

Basic problem

Post by Anthony » Tue Jan 11, 2005 8:41 am

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

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue Jan 11, 2005 8:50 am

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);
Marjan Slatinek,
http://www.steema.com

Anthony
Newbie
Newbie
Posts: 35
Joined: Wed Feb 25, 2004 5:00 am
Location: WL| Delft Hydraulics, Holland
Contact:

Post by Anthony » Tue Jan 11, 2005 8:57 am

Yeah ... Thanks.

Antoon Koster

Post Reply