给X轴添加滚动条,放大X轴Y轴

见Dundas自带的Chart Features->Axis->Scrolling and zooming示例,

首先引用下面语句

using Dundas.Charting.WebControl;

...

若在自己的代码中若是单击按钮后显示图表,则将里面的代码写到按钮事件中

private void Page_Load(object sender, System.EventArgs e)

{



    // scrolling and zooming will force keeping of series data between callbacks.

    this.Chart1.ChartAreas["Default"].CursorX.UserEnabled = true;



    // Set restriction on how far the user can zoom in

    this.Chart1.ChartAreas["Default"].AxisX.View.MinSize = 5;

    

    // Check AJAXZoomEnabled property.

    if (CheckBoxAJAXZoomEnabled.Checked)

    {

        Chart1.AJAXZoomEnabled = true;

    }

    else

    {

        Chart1.AJAXZoomEnabled = false;

    }

    

    if (!this.Page.IsPostBack)

    {

        // Set initial X axis zooming

        this.Chart1.ChartAreas["Default"].AxisX.View.Position = 10.0;

        this.Chart1.ChartAreas["Default"].AxisX.View.Size = 25.0;

        

        // populate data here...

    

    }

}

...

你可能感兴趣的:(滚动条)