boxplot horizsize and logical pixels

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
simon
Newbie
Newbie
Posts: 14
Joined: Tue Jan 20, 2009 12:00 am

boxplot horizsize and logical pixels

Post by simon » Wed May 13, 2009 1:37 am

hey,

im having trouble understanding how the boxplot/seriespoint.horizsize works. i have a chart with a few series of boxplots, the chart size is about 800pixels wide.

i want to fill say.... 3 boxplots into the chart, now, the default horizsize for each boxplot is 15. however, the unit of 15 isnt in pixels. it confuses me as to what the unit is.

if i want to make each box plot equal size to fill the entire chart, example, 800 wide / 3 series = 266pixels. if i assign 266 to the horizsize of the box, it seems to be larger than the normal pixel count.

i read in the help file: The HorizontalSize property specifies the Series Pointer width in logical pixels.

could u explain to me what a logical pixel is, and how i can get my boxplot widths to actually be 266 actual pixels.

hope that all makes sense.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Wed May 13, 2009 9:01 am

Hello simon,
could u explain to me what a logical pixel is, and how i can get my boxplot widths to actually be 266 actual pixels.
When you use for example box1.Pointer.HorizSize = 15, boxplot Series add 15 pixels to right and 15 pixels to left, so in total you have 30 pixels in boxplot series.

If you want, you could do a similar as in next example:

Code: Select all

        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            tChart1.Width = 800;
            Steema.TeeChart.Styles.Box box1 = new Steema.TeeChart.Styles.Box(tChart1.Chart);
            Steema.TeeChart.Styles.Box box2 = new Steema.TeeChart.Styles.Box(tChart1.Chart);
            Steema.TeeChart.Styles.Box box3 = new Steema.TeeChart.Styles.Box(tChart1.Chart);
            box1.FillSampleValues();
            box2.FillSampleValues();
            box3.FillSampleValues();

            box1.Position = 1;
            box2.Position = 2;
            box3.Position = 3;
            
            box1.Color = Color.Blue;
            box2.Color = Color.Red;
            box3.Color = Color.Orange;

            tChart1.Draw();

            Rectangle rect = tChart1.Chart.ChartRect;
            int boxWidth = rect.Width / tChart1.Series.Count;

            foreach (Steema.TeeChart.Styles.Box b in tChart1.Series)
            {
                b.Pointer.HorizSize = (int)(boxWidth / 2);
            }

            tChart1.Axes.Bottom.SetMinMax(0.5, 3.5);
        }

I hope that will help.

Thanks,
Best Regards,
Sandra Pazos / 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

simon
Newbie
Newbie
Posts: 14
Joined: Tue Jan 20, 2009 12:00 am

Post by simon » Wed May 13, 2009 11:42 pm

well clearly that makes sense... problem solved.

as a side note, i think it would be great if you guys mentioned this in the helpfile for horizsize.

thanks

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Thu May 14, 2009 8:46 am

Hello simon,

I add your suggestion to the list of enhancement.

Thanks,
Best Regards,
Sandra Pazos / 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