Page 1 of 1
Graph Generated in a Class
Posted: Fri Jul 03, 2009 10:04 am
by 8123522
Have got graphs working on a website, I have a class routine with generates a XML file. It is possible to use the graph software in just a class, as I can't seem to work out how oyu would setup the graph etc
Re: Graph Generated in a Class
Posted: Fri Jul 03, 2009 2:37 pm
by narcis
Hi MikeTheLad,
Yes, you could reference TeeChart.dll at the project and use a chart at runtime, for example:
Code: Select all
public class MyChartClass
{
public MyChartClass()
{
Steema.TeeChart.TChart myChart = new Steema.TeeChart.TChart();
Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(myChart.Chart);
bar1.FillSampleValues();
myChart.Export.Image.JPEG.Save(@"c:\temp\runtimechart.jpg");
}
}
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
MyChartClass theChart = new MyChartClass();
}
}