Click here to Skip to main content
15,886,725 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi, I have created a Box plot chart. However, the box of the box plot chart is very big. Does anyone know how can I adjust the size of the box plot? Secondly, The PointY Average Shape is now a straight line. How can I change it into a diamond shape?

This is what I have now: Please see the pic from this link: (http://i.stack.imgur.com/My7MT.png[^]).

This is the output I want to achieve: (See here: http://i.stack.imgur.com/2ybT0.png[^]).

This is my codes:
HTML
Chart1.DataSource = tg;
            Chart1.Width = 600;
            Chart1.Height = 350;

            Chart1.Series.Add(new Series());
            Chart1.Series[0].ChartType = SeriesChartType.BoxPlot;
            List<object> lst = tg.AsEnumerable().ToList<object>();

            foreach (DataRow row in tg.Rows)
                Chart1.Series[0].Points.AddXY(row["Status"], new object[] { row["MAX"], row["MIN"], row["AVG"], row["PERCENTILE25"], row["PERCENTILE50"], row["PERCENTILE75"] });
            Chart1.Series[0].Color = Color.White;
            Chart1.Series[0].BorderColor = Color.MidnightBlue;
            Chart1.Series[0].ChartType = SeriesChartType.BoxPlot;
            if (tg.Rows.Count > 0)
            {
                string title = (tg.Rows[0]["Process"].ToString());
                Chart1.Titles.Add(title);
            }
            //create chartareas
            ChartArea ca = new ChartArea();
            ca.Name = "ChartArea1";
            ca.BackColor = Color.LightSkyBlue;
            ca.BorderColor = Color.Gray;
            ca.BorderWidth = 1;
            ca.BorderDashStyle = ChartDashStyle.Solid;
            ca.AxisX = new Axis();
            ca.AxisX.MajorGrid.LineColor = Color.LightSkyBlue;
            ca.AxisX.MajorTickMark.LineColor = Color.Gray;
            ca.AxisY = new Axis();
            ca.AxisY.MajorGrid.LineColor = Color.LightSkyBlue;
            ca.AxisY.MajorTickMark.LineColor = Color.Gray;
            Chart1.ChartAreas.Add(ca);
            Chart1.ChartAreas[0].AxisX.Interval = 1;
            Chart1.ChartAreas[0].AxisY.Interval = 5;

            //databind
            Chart1.DataBind();
            Chart1.Visible = true;


Question:
How to set the size of the box of box plot chart so that it is not this big?

How to change the shape of the PointY Average from straight line to a diamond shape?


Appreciate if someone can help me on this. Thanks.
Posted
Updated 27-Sep-15 22:32pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900