Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42225

VS 2010 Need some help with the chart object

$
0
0
Alright I used this code:
Code:

Imports System.Windows.Forms.DataVisualization.Charting

Public Class Form1
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Dim x(100), y(100) As Double
        Chart1.Series.Clear()
        Chart1.ChartAreas(0).AxisX.Interval = 5
        Chart1.ChartAreas(0).AxisX.MajorGrid.Interval = 5
        Chart1.ChartAreas(0).AxisY.Interval = 5
        Chart1.ChartAreas(0).AxisY.MajorGrid.Interval = 5
        Chart1.ChartAreas(0).AxisX.Minimum = 0
        Chart1.ChartAreas(0).AxisX.Maximum = 100
        Chart1.ChartAreas(0).AxisY.Minimum = 0
        Chart1.ChartAreas(0).AxisY.Maximum = 100
        Dim ex As New Series
        ex.ChartType = SeriesChartType.FastLine
        Chart1.Series.Add(ex)
        For i = 0 To 100
            x(i) = i
            y(i) = i * i * 2
        Next
        ex.Points.DataBindXY(x, y)
    End Sub
End Class

To get this:
Attachment 93281

My question is how do i get that jagged edge to be smooth?
I was thinking that doing mroe samples would fix it like using x(200) and y(200) instead of x(100) and y(100) but with each point being 0.5,1,1.5,2,2.5....

so i implemented this with a different equation
Code:

For i = 0 To 100
            For j = 1 To 2
                x(i) = i / j
                y(i) = Math.Sin(x(i))
            Next
        Next

But now it only goes upto 50

So my question is how do I make the graph smooth while making it show completely?
Attached Images
 

Viewing all articles
Browse latest Browse all 42225

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>