【问题标题】:how to display chart title as dropdownlist selected item in asp.net如何在asp.net中将图表标题显示为下拉列表中的选定项
【发布时间】:2014-07-21 13:23:58
【问题描述】:

如果我从下拉列表中选择一个项目,那么它会在图表控件中将文本显示为标题

 <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>

现在 Graph 将“Daily MeatSale Graph”显示为标题,但我想显示如下标题 “每日肉类销售图表 - BranchName” 看这样的演示:Telerik ASP.NET Chart Demo

http://demos.telerik.com/aspnet-ajax/chart/examples/databinding/database/defaultcs.aspx

【问题讨论】:

    标签: c# asp.net charts


    【解决方案1】:
      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);  
    

    【讨论】:

      猜你喜欢
      • 2017-06-27
      • 2016-01-28
      • 2022-07-24
      • 2015-11-29
      • 2011-02-15
      • 1970-01-01
      • 1970-01-01
      • 2019-09-13
      • 1970-01-01
      相关资源
      最近更新 更多