如何在asp.net中将图表标题显示为下拉列表中选定的项目
本文关键字:下拉列表 显示 项目 标题 asp net | 更新日期: 2023-09-27 18:14:09
如果我从下拉列表中选择了一个项目,那么它将在图表控件中显示文本作为标题
<asp:Chart ID="Chart1" runat="server" Height="350px" Width="600px" Style="text-align: center;
margin-left: auto; margin-right: auto; ">
<Titles>
<asp:Title Font="Times New Roman, 12pt, style=Bold, Italic" Name="Title1" Text="Daily MeatSale Graph" >
</asp:Title>
</Titles>
<Legends>
<asp:Legend Docking="Bottom" IsTextAutoFit="False" Name="MeatinKgs" LegendStyle="Row" />
</Legends>
<Series>
<asp:Series Name="Meat in Kgs" ToolTip="#VALX [#VALY Kgs]" YValuesPerPoint="1" />
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
现在图表显示"每日肉类销售图表"作为标题,但我想显示标题像"每日肉类销售图表- BranchName"看到这样的演示:Telerik ASP。. NET图表演示
http://demos.telerik.com/aspnet-ajax/chart/examples/databinding/database/defaultcs.aspx string s = "Daily MeatSale Graph - " + Request.QueryString["branchname"].ToString();
Chart1.ChartAreas[0].AxisX.Title = "Dates";
Chart1.ChartAreas[0].AxisY.Title = "Meat In Kgs";
Chart1.Titles.Add(s);