Search code examples
boxplotteechart

Plot very large number of box plots (range between 1 to 10,000) using Tee chart


I need to allow user to select Start and End data. Once it is selected, i need to fetch all the group data between these dates and display box plot. The problem is box plots are overlaid if there are many box plot needs to be displayed. Tee chart does not automatically shrink the size of boxplot. Also, does not provide scroll to bar to adjust bottom axis to accommodate all the box plots. Any solution ?


Solution

  • I used your code in C# but it did not adjusted the width of box and they were overlapping.

    private void button3_Click_1(object sender, EventArgs e)
        {
                tChart1.Aspect.View3D = false;
                tChart1.Legend.Visible = false;
                for(int i=0;i<100;i++)
                {
                    Steema.TeeChart.Styles.Box b = new Steema.TeeChart.Styles.Box();
                    tChart1.Series.Add(b);
                    b.Position = i;
                    b.FillSampleValues();
                }
    
                tChart1.Panning.Allow = ScrollModes.Horizontal;
                tChart1.Zoom.Direction = ZoomDirections.Horizontal;
    
                ReCalculateBoxWidth();
    
            }
        public void ReCalculateBoxWidth()
        {
            int boxW;
            double tmpW;
    
            tChart1.Draw();
    
            tmpW = (tChart1.Chart.ChartRect.Right - tChart1.Chart.ChartRect.Left) / (tChart1.Axes.Bottom.Maximum - tChart1.Axes.Bottom.Minimum) / 2;
            tmpW = tmpW * 0.9;
    
            boxW = (int)Math.Round(tmpW);
    
            foreach (Steema.TeeChart.Styles.CustomBox b in tChart1.Series)
            {
                b.Box.SizeUnits = Steema.TeeChart.Styles.PointerSizeUnits.Pixels;
                b.Box.SizeDouble = boxW;
            }
    
            tChart1.Draw();
    
        }
    

    BoxPlot