1

my only objective is to create a scatter plot with only x and y axes. the data source should be from a 1 dimensional array.

say i have these arrays:

  • x() as Object ' for x axis values
  • y() as Object ' for y axis values

and i have this chart:

chart1

the arrays are already filled with data. my question is: how do i enter the array data on chart1 such that x() values will be the x-axis values for chart 1 and y() will be the y-axis values for chart 1. what code should i use to make the chart show a scatter plot using the data from the arrays?

your reply will be very much appreciated. thanks in advance.

Michael
  • 1,849
  • 18
  • 38
maohvlean19
  • 29
  • 3
  • 8

2 Answers2

2

Look at chart properties under Chart>Series and change Series1 ChartType to Point.

    Dim x() As Integer = {1, 2, 3, 4, 5}
    Dim y() As Integer = {2, 1, 7, 3, 3}

    Chart1.Series("Series1").Points.DataBindXY(x, y)
Michael
  • 1,849
  • 18
  • 38
  • this has answered my question. I will stick with the Chart control for now and will learn to use it before trying the zedgraph. again, thank you. – maohvlean19 Mar 05 '11 at 15:37
0

Check out Zedgraph. It's a free graphing library that works great. There are lots of code samples on their website that allow you to do what you're asking. Zedgraph Downloads Their website seems to be having issues right now, but the download session works and contains all of their sample files.

Davido
  • 2,913
  • 24
  • 38