Page 1 of 1

boxplot horizsize and logical pixels

Posted: Wed May 13, 2009 1:37 am
by 13051546
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.

Posted: Wed May 13, 2009 9:01 am
by 10050769
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,

Posted: Wed May 13, 2009 11:42 pm
by 13051546
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

Posted: Thu May 14, 2009 8:46 am
by 10050769
Hello simon,

I add your suggestion to the list of enhancement.

Thanks,