VB.NET Chart Horizontal Scroll or Fit to Screen When Resizing Forms - Please Help (HOW)

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Me.Chart1.Series("Rate").Points.AddXY("Rowel", 27)
        Me.Chart1.Series("Rate").Points.AddXY("Rona", 24)
        Me.Chart1.Series("Rate").Points.AddXY("Edwin", 28)
        Me.Chart1.Series("Rate").Points.AddXY("Rock", 29)
        Me.Chart1.Series("Rate").Points.AddXY("Ben", 30)
        Me.Chart1.Series("Rate").Points.AddXY("July", 25)
        Me.Chart1.Series("Rate").Points.AddXY("King", 54)
        Me.Chart1.Series("Rate").Points.AddXY("Coby", 64)
        Me.Chart1.Series("Rate").Points.AddXY("Rhian", 74)
        Me.Chart1.Series("Rate").Points.AddXY("Josh", 84)
        Me.Chart1.Series("Rate").Points.AddXY("Ping", 94)
        Me.Chart1.Series("Rate").Points.AddXY("Cardo", 104)
        Me.Chart1.Series("Rate").Points.AddXY("Fact Boy", 234)
        Me.Chart1.Series("Rate").Points.AddXY("Jame", 254)
        Me.Chart1.Series("Rate").Points.AddXY("Bunso", 264)
    End Sub
End Class

Open in new window


That's how I created the chart,
fewaf.JPGProblem is the space of charts How can I Fit this to screen or can I have a scroll bar?
Rowel VirgoVisual Studio .NETAsked:
Who is Participating?
 
Dustin SaundersConnect With a Mentor Director of OperationsCommented:
The chart has a method to adjust the scaling:

chart1.ChartAreas[0].RecalculateAxesScale();

Open in new window


Example (C#):

string[] series = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen" };
int[] points = { 10, 33, 42, 34, 65, 89, 55, 20, 15, 64, 44, 51, 32 };

for (int i = 0; i < series.Length; i++)
{
     chart1.Series[0].Points.AddXY(series[i],points[i]);
 }

chart1.ChartAreas[0].RecalculateAxesScale();

Open in new window


chart1.png
1
 
Rowel VirgoVisual Studio .NETAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.