我使用以下代码在我的页面上显示ASP.NET图表控件,它工作正常。我的问题是,我需要在x轴上设置水平滚动条,
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();
}
这是ASP.NET图表控件。
答案 0 :(得分:0)
我可以通过简单地将图表放到面板并将面板的ScrollBars
属性设置为“水平”来实现
<asp:Panel ID="Panel3" runat="server" ScrollBars="Horizontal">
<asp:Chart
....
</asp:Chart>
</asp:Panel>
答案 1 :(得分:0)
chart1.ChartAreas [“ChartArea1”]。AxisX.ScaleView.Zoomable = true; chart1.ChartAreas [“ChartArea1”]。AxisX.ScrollBar.IsPositionedInside = true;