This is a migrated thread and some comments may be shown as answers.

set individual seriesitem bubblesize

5 Answers 104 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
AVH
Top achievements
Rank 1
AVH asked on 26 May 2008, 09:22 PM
hello,

i have radchart that i create programmatically.  i add a few line series and 1 bubble series programmatically

i would like to control the point sizes of each series item individually in the bubble series.  i cannot seem to control the individual point sizes of either a point series or a bubble series.

i have autosize = false;  here is some code i am using.

               Telerik.Charting.ChartSeries rulecs = new Telerik.Charting.ChartSeries();
                rulecs.Name = Resources.MyGlobalResources.Rules;
                rulecs.Appearance.FillStyle.MainColor = Color.Green;
                rulecs.Appearance.FillStyle.SecondColor = Color.Green;
                rulecs.Appearance.BubbleSize = 4;
                rulecs.Type = Telerik.Charting.ChartSeriesType.Bubble;
                rulecs.Appearance.PointMark.FillStyle.MainColor = Color.Green;
                rulecs.Appearance.PointMark.FillStyle.SecondColor = Color.Green;
                rulecs.Appearance.LegendDisplayMode = Telerik.Charting.ChartSeriesLegendDisplayMode.Nothing;
                rulecs.Appearance.PointDimentions.AutoSize = false;          
                rulecs.Appearance.ShowLabels = false;
                rulecs.Appearance.LabelAppearance.Visible = false;

then

to control each individual points

                        if (cbl_rules.Items[0].Selected)
                        {
                            for (int i = 0; i < a.Length; i++)
                            {
                                if (a[i])
                                {
                                    if (rulecs.Items[i].ActiveRegion.Tooltip.Length > 0)
                                        rulecs.Items[i].ActiveRegion.Tooltip = rulecs.Items[i].ActiveRegion.Tooltip + "," + Resources.MyGlobalResources.R1;
                                    else
                                        rulecs.Items[i].ActiveRegion.Tooltip = Resources.MyGlobalResources.R1;
                                    rulecs.Items[i].PointAppearance.Dimensions.AutoSize = false;
                                    rulecs.Items[i].PointAppearance.Dimensions.Height = 6;
                                    rulecs.Items[i].Appearance.FillStyle.MainColor = Color.Red;
                                    rulecs.SetItemColor(i, Color.Red);
                                    rulecs.Items[i].Appearance.FillStyle.MainColor = Color.Red;
                                    rulecs.Items[i].Appearance.FillStyle.SecondColor = Color.Red;
                                    rulecs.Items[i].PointAppearance.Dimensions.Width = 6;
                                }
                            }
                        }

else leave the point as the original size and color.

the points only seem to change when i change the following code

rulecs.Appearance.BubbleSize = 4;

please help as i have looked through the help and forums but have not been able to control the sizing of each point individually.  that said, i can control the color.  please let me know, thanks.

questions.

1.  can i control the size and color of each individual point separately in a point and bubble series? if so, how, if not, why not?

thanks again,


avh

5 Answers, 1 is accepted

Sort by
0
AVH
Top achievements
Rank 1
answered on 27 May 2008, 01:43 PM
weird, but i got it.

thanks,

avh
0
Rick
Top achievements
Rank 1
answered on 03 Jun 2008, 08:07 PM
I'm having the same issue, can you share what the secret was to controling the point sizes individually?  I;m trying it in my ItemDataBound event and can get everything but the size to play nice.

Thanks in advance,
Rick
0
AVH
Top achievements
Rank 1
answered on 03 Jun 2008, 08:14 PM
Rick,

1.  Pick point series.
2.  Make sure Autosize is false.
3.  Use the correct code to set the size.

Example below.

use this code

Telerik.Charting.

ChartSeries rulecs = new Telerik.Charting.ChartSeries();

rulecs.Name = Resources.

MyGlobalResources.Rules;

rulecs.Appearance.FillStyle.MainColor =

Color.Black;

rulecs.Appearance.FillStyle.SecondColor =

Color.Black;

rulecs.Type = Telerik.Charting.ChartSeriesType.Point;

rulecs.Appearance.PointMark.FillStyle.MainColor =

Color.Black;

rulecs.Appearance.PointMark.FillStyle.SecondColor =

Color.Black;

rulecs.Appearance.PointDimentions.AutoSize = false;

//rulecs.Appearance.PointMark.Dimensions.Height = 6;

//rulecs.Appearance.PointMark.Dimensions.Width = 6;

rulecs.Appearance.PointDimentions.Width = 6;

rulecs.Appearance.PointDimentions.Height = 6;


rulecs.Items[i].Appearance.PointDimentions.AutoSize =

false;

rulecs.Items[i].Appearance.PointDimentions.Height = Telerik.Charting.Styles.

Unit.Pixel(9);

rulecs.Items[i].Appearance.PointDimentions.Width = Telerik.Charting.Styles.

Unit.Pixel(9);

rulecs.Items[i].Appearance.FillStyle.MainColor =

Color.Red;

and not the code below

rulecs.Items[i].PointAppearance.Dimensions.Height = Telerik.Charting.Styles.

Unit.Pixel(9);

rulecs.Items[i].PointAppearance.Dimensions.Width = Telerik.Charting.Styles.

Unit.Pixel(9);

rulecs.Items[i].PointAppearance.Dimensions.AutoSize =

false;


it was and still is confusing to me.  you can see that i tried both scenarios and commented them out.  i searched the help but the help was of no help to me in this case.


good luck with this spooky stuff,

avh
0
Rick
Top achievements
Rank 1
answered on 03 Jun 2008, 08:21 PM
Hmmm, that is weird...but adding the autosize = false EACH TIME I wanted to mess with a point in code was the trick.

I'd seen postings eluding to that in the forums, but I set Autosize to false for both PointDimensions and PointMark through the designer (Chart Series Collection Editor), so I assumed that since I was setting it for the series, it would apply to each of the points....guess not.

Thanks for the quick response, you saved me from a few more hours of forum dredging.

Take the rest of the day off,
Rick
0
AVH
Top achievements
Rank 1
answered on 03 Jun 2008, 08:24 PM
Rick,

No problem!

avh
Tags
Chart (Obsolete)
Asked by
AVH
Top achievements
Rank 1
Answers by
AVH
Top achievements
Rank 1
Rick
Top achievements
Rank 1
Share this question
or