MSChart Scrollbar Stuck RRS feed

  • Question

  • Hey guys, new to the community, hope someone can help.

    Im creating a tool that uses real time threading to process data and graph it, using a spline series type

    I have 2 problems:

    1)When the scroll bar appears it is always fixed at the leftmost(oldest) data points, is it possible to have to automatically show the newest data, in other words constantly stay to the right.

    2)Im using a Datetime xaxis with and having a set Scaleview. When the scrollbar appears I cannot move it left or right by clicking and dragging, however it works when i use the side arrows. Same thing happens when zoomed in

    Thanks guys, hope yall can help

    Here are my chart settings:

                //Initial x-axis min        
                chart1.ChartAreas[0].AxisX.Minimum = DateTime.Now.AddSeconds(-5).ToOADate();

                // chart_zooming
                chart1.ChartAreas[0].CursorX.IsUserEnabled = true;
                chart1.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
                chart1.ChartAreas[0].CursorX.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Seconds;
                chart1.ChartAreas[0].CursorX.Interval = 0;
                chart1.ChartAreas[0].CursorX.AutoScroll = true;

                //x-axis format
                chart1.ChartAreas[0].AxisX.LabelStyle.Format = "mm:ss";
                chart1.ChartAreas[0].BorderWidth = 3;
                chart1.ChartAreas[0].BorderColor = Color.Black;
                //horizontal scrollbar
                chart1.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = true;
                chart1.ChartAreas[0].AxisX.ScrollBar.Size = 15;
                chart1.ChartAreas[0].AxisX.ScrollBar.Enabled = true;
                //Number of points displayed at a time
                chart1.ChartAreas["Default"].AxisX.ScaleView.SizeType = DateTimeIntervalType.Seconds;
                chart1.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
                chart1.ChartAreas["Default"].AxisX.ScaleView.Size = 30;
                chart1.ChartAreas[0].AxisX.ScaleView.SmallScrollSizeType = DateTimeIntervalType.Seconds;
                chart1.ChartAreas[0].AxisX.ScaleView.SmallScrollSize = 1;

    • Moved by Lie You Thursday, December 22, 2011 3:50 AM Move it for good discussion (From:Visual C# General)
    Tuesday, December 20, 2011 5:01 PM

All replies

  • I moved it to here for better support.

    Thanks for your understanding and support.

    Best Regards,
    Rocky Yue[MSFT]
    MSDN Community Support | Feedback to us
    Thursday, December 22, 2011 3:51 AM
  • hay 

    Pramod Heare actualy i want to realy appriacite u.....Yaar.

    its very big task for me to show zooming and and scroll bar to chart control ......nice ...


    and also alex is very help to us ....Thanking to alex & u......Pramod 9503866693

    Saturday, January 21, 2012 11:46 AM