用表创建图形

时间:2014-01-21 12:38:15

标签: c# charts

for (int t = 0; t < ARF.Rows.Count; t += 1)
{
    Chart1.Series[t].ChartType = SeriesChartType.Column;
    Chart1.Series[t].BorderWidth = 2;

    Chart1.Series[t].ToolTip = "(#VALX,#VALY)";
    Chart1.ChartAreas["ChartArea1" + t.ToString()].AxisX.Title = "Learning Domains";
    Chart1.ChartAreas["ChartArea1" + t.ToString()].AxisY.Title = "Covered";


    Chart1.Legends.Add("Legend1" + t.ToString());
    Chart1.Legends["Legend1" + t.ToString()].Enabled = false;
    // Chart1.Legends["Legend1" + t.ToString()].Docking = Docking.Bottom;
    Chart1.Legends["Legend1" + t.ToString()].Alignment = System.Drawing.StringAlignment.Center;
    Chart1.Legends["Legend1" + t.ToString()].DockedToChartArea = "ChartArea1" + t.ToString();
    // Chart1.Legends["Legend1" + t.ToString()].IsDockedInsideChartArea = false;
    Random random = new Random();
    foreach (var item in Graph.Series[0].Points)
    {
        System.Drawing.Color c = System.Drawing.Color.FromArgb(random.Next(0, 255), random.Next(0, 255), random.Next(0, 255));
        item.Color = c;

    }

    Chart1.Series[t]["PointWidth"] = "0.2";
    Chart1.Series[t]["BarLabelStyle"] = "Center";
    Chart1.Series[t]["PixelPointDepth"] = "99";
    Chart1.Series[t]["DrawingStyle"] = "Cylinder";

}

for (int i = 0; i < 5; i++)
{
    GridView gv = new GridView();
    gv.DataSource = ds;
    ph.Controls.Add(gv);
}

这是创建5个图表的代码,我想要5个图表,其中5个图表的网格视图数据一起拍摄。你能不能帮我做...我已经尝试了但是图表即将到来并且网格不可见。

1 个答案:

答案 0 :(得分:0)

如果您使用的是网络应用程序,则可以使用谷歌图表: 你可以参考这个链接:

https://developers.google.com/chart/interactive/docs/gallery/controls