0
使用asp.net圖表控件爲柱子賦予不同的顏色。手動添加列可以給出不同的顏色,但是當使用動態/數據源添加列時,不能給出不同的顏色。 這是使用的數據表我的圖表使用Asp.net圖表控件爲每個柱子賦予不同的顏色
<asp:Chart ID="chartPerformance" runat="server" BackColor="OldLace"
IsMapEnabled="False" Width="600px" Height="350px" BackGradientStyle="TopBottom"
Palette="Chocolate">
<Series>
<asp:Series Name="Series1" XValueMember="ReportName" YValueMembers="TimeTaken"
IsValueShownAsLabel="true" YValuesPerPoint="6">
<SmartLabelStyle Enabled="false" />
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
<AxisY>
<MajorGrid Enabled="False" />
</AxisY>
<AxisX>
<MajorGrid Enabled="False" />
</AxisX>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
分配數據的代碼。
chartPerformance.DataSource = dt;
chartPerformance.DataBind();
它不工作 – 2012-02-06 06:48:10