如何调整Box绘图大小并更改PointY平均形状

时间:2015-09-28 08:28:10

标签: javascript c# asp.net charts

我创建了一个Box图表。但是,箱形图的框很大。有谁知道如何调整盒子图的大小?其次,PointY平均形状现在是一条直线。如何将其更改为菱形?

这就是我现在所拥有的:请参阅此链接中的图片:(http://i.stack.imgur.com/My7MT.png)。

这是我想要实现的输出:(见这里:http://i.stack.imgur.com/2ybT0.png)。

这是我的代码:

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;

问题:如何设置箱形图表框的大小,使其不是很大?

如何将PointY Average的形状从直线更改为菱形?

感谢有人可以帮助我。感谢。

0 个答案:

没有答案