Fixed pixel size for bubble radius

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ido
Newbie
Newbie
Posts: 19
Joined: Thu Aug 31, 2006 12:00 am

Fixed pixel size for bubble radius

Post by ido » Tue May 19, 2009 10:04 am

Hi,
I'm using Bubble line to mark some points on a teeChart .net control.
how can i set the bubble radius to fixed size (in pixel) so it won't resize on zoom according to the axes?

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

Post by Narcís » Tue May 19, 2009 2:37 pm

Hi miki,

In that case you should set bubble's radius to change dynamically according to chart dimensions instead of axes scales and update those values every time chart is zoomed or unzoomed. I think it's much easier using Points series for that with its Pointer.Style property set to display a circle. With Points series you can set pointer dimensions in pixels, for example:

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private void InitializeChart()
		{
			Steema.TeeChart.Styles.Points points1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);

			points1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
			points1.Pointer.HorizSize = 5;
			points1.Pointer.VertSize = 5;

			points1.Add(0, 1, Color.Red);
			points1.Add(1, 6, Color.Blue);
			points1.Add(2, 2, Color.Yellow);
			points1.Add(3, 3, Color.Green);
		}
If you need to use different sizes for each point then you can use a new series for every point you want to plot, for example:

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private void InitializeChart()
		{
			AddPoint(0, 1, 3, Color.Red);
			AddPoint(1, 6, 4, Color.Blue);
			AddPoint(2, 2, 1, Color.Yellow);
			AddPoint(3, 3, 2, Color.Green);
		}

		private void AddPoint(double x, double y, int radius, Color color)
		{
			Steema.TeeChart.Styles.Points points1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);

			points1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
			points1.Pointer.HorizSize = radius;
			points1.Pointer.VertSize = radius;

			points1.Add(x, y, color);
		}
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