Page 1 of 1

Fixed pixel size for bubble radius

Posted: Tue May 19, 2009 10:04 am
by 9642362
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?

Posted: Tue May 19, 2009 2:37 pm
by narcis
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);
		}