سؤال

I am using the following code to display ASP.NET chart control on my page and it is working fine. My problem is, I need to set horizontal scroll bar on x-axis,

protected void BindDataToChart2()
{
    Chart1.DataSource = local_ds.Tables[3];
    Chart1.Legends.Add("legend1").Title = "LocalIP Details";
    Chart1.ChartAreas["ChartArea1"].AxisX.Title = "Login Date";
    Chart1.ChartAreas["ChartArea1"].AxisY.Title = "No. of Clients";
    Chart1.Series["Series2"].XValueMember = "LoginDate";
    Chart1.Series["Series2"].YValueMembers = "clients";
    Chart1.DataBind();
}

and this is ASP.NET chart control.

هل كانت مفيدة؟

المحلول

I can be achieved by simply putting the Chart to a Panel and setting the Panel's ScrollBars Property to "Horizontal"

   <asp:Panel ID="Panel3" runat="server" ScrollBars="Horizontal">
       <asp:Chart 
           ....
       </asp:Chart>
   </asp:Panel>

نصائح أخرى

chart1.ChartAreas["ChartArea1"].AxisX.ScaleView.Zoomable = true; chart1.ChartAreas["ChartArea1"].AxisX.ScrollBar.IsPositionedInside = true;

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top