Graph Generated in a Class

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
MikeTheLad
Newbie
Newbie
Posts: 65
Joined: Mon Jan 19, 2004 5:00 am

Graph Generated in a Class

Post by MikeTheLad » Fri Jul 03, 2009 10:04 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Graph Generated in a Class

Post by Narcís » Fri Jul 03, 2009 2:37 pm

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();
		}

	}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply