Note that there are some explanatory texts on larger screens.

plurals
  1. POhorizontal ScrollBar in MsChart
    text
    copied!<p>Somewhere in internet I found this code</p> <pre><code> private void PopulateChart() { int elements = 500; Random r = new Random(); List&lt;double&gt; xValues = new List&lt;double&gt;(); double currentX = 0; for (int i = 0; i &lt; elements; i++) { xValues.Add(currentX); currentX = currentX + r.Next(1, 2000); } List&lt;double&gt; yValues = new List&lt;double&gt;(); for (int i = 0; i &lt; elements; i++) { yValues.Add(r.Next(0, 50)); } // remove all previous series chart1.Series.Clear(); var series = chart1.Series.Add("MySeries"); series.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Stock; //series.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Auto; DateTime baseDate = DateTime.Today; for (int i = 0; i &lt; xValues.Count; i++) { var xDate = baseDate.AddSeconds(xValues[i]); var yValue = yValues[i]; series.Points.AddXY(xDate, yValue); } // show an X label every itme interval (values in minute 60 = 1 hour) chart1.ChartAreas[series.ChartArea].AxisX.Interval = 100.0; chart1.ChartAreas[0].AxisX.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Minutes; // label format chart1.ChartAreas[0].AxisX.LabelStyle.Format = "HH:mm:ss"; } </code></pre> <p>This displays random data in chart with grouping of data with some time interval. Now I want to put a horizontal scrollbar (x-axis). I tried using code used in this post</p> <p><a href="https://stackoverflow.com/questions/5141126/adding-a-scroll-bar-to-ms-chart-control-c-sharp">Adding a scroll bar to MS Chart control C#</a></p> <p>but I couldnot apply it with full functionality. Can anyone help me in this problem?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload