Page 1 of 1

spatial view for charting

Posted: Tue Jun 19, 2007 10:35 am
by 8119968
Dear All,

I would like to chart the spatial view series in TeeChart. What I would like to do I have the name in the X-Axis and Values on the Y Axis.

I would like to show a dot size that is large for large Y values and small for small X values. Either the smallest dots will be the most negative values or the negative values will be shown in a different colour.

Is there anyway to implement this in TeeChart? Please advise.

Regards,

LG

Posted: Tue Jun 19, 2007 10:49 am
by narcis
Hi LG,

You could try doing this with bubble series where you can specify each bubble radius. You could make radius proportional to Y value. You can also set the bubble style (circle, rectangle, triangle, etc.). You'll find examples at the features demo at All Features\Welcome !\Chart styles\Standard\Bubble. Features demo can be found at TeeChart's program group.

Posted: Wed Jun 20, 2007 7:21 am
by 8119968
Thanks for that. I am now using the bubble. I am trying to split the positive and negative values with different colour. My TeeChart version is 1.0

I am using like this but it just does not work. Acutally in my case, it should be 40% red and 60% blue of all bubbles in the chart as there are 40% of negative values. Strangly I see just a couple of pink colour, and dark red colour!

Code: Select all

buble.ColorEach = true;
if (fltRadius < 0) 
{
 buble.Add(floatX, floatY, fltRadius, strLabel, Color.Red);
}
else
{
 buble.Add(floatX, floatY, fltRadius, strLabel, Color.Blue);
}

Posted: Wed Jun 20, 2007 8:38 am
by 9348258
Hi LG

The add methods to Bubble Series works the follow way: (X,Y) parameters are the position of the center of Bubble. The radius can't be negative, so you should to put the radius with absolut value, as below code:

Code: Select all

 bubble1.ColorEach = true;
           Random X = new Random();
           Random Y = new Random();
           for (int i = -5; i < 5; i++)
           {
               if (i < 0)
                    bubble1.Add(X.Next(10), Y.Next(10), Math.Abs(i), "Red "+i.ToString(),Color.Red);
               else
                    bubble1.Add(X.Next(10), Y.Next(10), Math.Abs(i), "Blue "+i.ToString(),Color.Blue);
           }
Another question is that the color isn't painted correctly in version 1. I've tried it with the version 3, and it works fine.