我正在使用 asp:Chart 来显示图表。加载页面时会显示图表。我想为图表控件添加效果,比如条形应该慢慢地从 0 上升到某个值(取决于 y 值)。如何使用 asp:chart 添加这样的效果?
这是我在 .aspx 页面中的图形代码。
<asp:Chart ID="DashboardGraph" runat="server" BackColor="#D3DFF0" Palette="BrightPastel"
BorderDashStyle="Solid" BackGradientStyle="TopBottom" BorderWidth="2" BorderColor="26, 59, 105"
ImageLocation="~/TempImages/ChartPic_#SEQ(500,3)" Width="500px" Height="350px">
<Titles>
<asp:Title ShadowColor="32, 0, 0, 0" Font="Trebuchet MS, 14.25pt, style=Bold" ShadowOffset="3"
Text="Inventory Statistics" ForeColor="26, 59, 105">
</asp:Title>
</Titles>
<Legends>
<asp:Legend Docking="Right" BackColor="Transparent">
</asp:Legend>
</Legends>
<BorderSkin SkinStyle="Emboss"></BorderSkin>
<Series>
<asp:Series Name="ProductName" ChartType="Column" YValueType="Int32" IsValueShownAsLabel="true">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid"
BackSecondaryColor="Transparent" BackColor="64, 165, 191, 228" ShadowColor="Transparent"
BackGradientStyle="TopBottom" >
<Area3DStyle Rotation="10" Inclination="15" WallWidth="0" />
<AxisY LineColor="64, 64, 64, 64" LabelAutoFitMaxFontSize="8" Title="Quantity" >
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</AxisY>
<AxisX LineColor="64, 64, 64, 64" LabelAutoFitMaxFontSize="8" Interval="1" TitleAlignment="Near" Title="Products">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</AxisX>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
下面是将 asp:chart 与数据表绑定的代码
DataTable dtGraph = objDashboard.GetDahboardGraphData();
DashboardGraph.DataSource = dtGraph;
DashboardGraph.Series["ProductName"].XValueMember = "ProductName";
DashboardGraph.Series["ProductName"].YValueMembers = "Total";
DashboardGraph.DataBind();