0

我有课 :

public class ChartEntity4
{
    public DateTime Date { get; set; }
    public string STM1Number { get; set; }
    public float Utilization{ get; set; }
    public string Type { get; set; }
}

我想将它绑定到图表控件 ASP.net 4.0,使 Date>> X 访问 Utilization 到 Y 访问,并通过颜色或其他东西来区分类型,你能帮我吗?

4

1 回答 1

0

类似的东西:在 aspx 代码中:

<asp:Series Name="Series1" XValueType="String" XValueMember="Date" YValueMembers="Utilization"
                                IsValueShownAsLabel="True" YValueType="float" ChartType="Pyramid" Palette="BrightPastel">
</asp:Series>

在cs文件中:

var ListOfChartEntity4 = new List<ChartEntity4>;
ListOfChartEntity4.Add(new ChartEntity4(); //add some things...
ListOfChartEntity4.Add(new ChartEntity4(); //add some more things...
ListOfChartEntity4.Add(new ChartEntity4(); //add even more things...
chartID.DataSource = ListOfChartEntity4; //Your data!
chartID.DataBind();
于 2012-09-09T10:31:07.137 回答