?
Solved

MSCHART

Posted on 2000-04-04
4
Medium Priority
?
720 Views
Last Modified: 2012-08-14
HELLO I AM TRYING TO PLOT 10 VALUES ON A
XY-SCATTER CHART USING THE MSCHART CONTROL. I HAVE ONE FILE WITH THESE VALUES 5,10,15,20,35,65,78,96,14,79
IN A TXT FILE. I WOULD LIKE TO PLOT
5,10 AS X AND Y AS ONE DATA POINT
15,20 AS X AND Y AS ONE DATA POINT
35,65 AS X AND Y AND GO THROUGH THE FILE UNTIL I HAVE 5 DATA POINTS ON THE GRAPH. HOW CAN READ THE VALUES OF THIS FILE AND PLOT ON XY-SCATTER IT SEEMS TO BE VERY EASY TO PLOT ONE VALUE BUT HOW DO YOU PLOT TWO VALUES! hOW CAN I READ TWO VALUES.
0
Comment
Question by:rudrasan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Accepted Solution

by:
TT earned 30 total points
ID: 2686063
Hi,
  I am not familiar with MSChart but
  below are the way u may read data
  from your text file, hope can help

'Code to set the data
Dim FileNo as integer
Dim YValue as string
Dim XValue as string

FileNo = FreeFile
Open [Your File Name] For Input As #FileNo  ' Open File for Input


For i = 0 to nSeries -1
   Line Input #FileNo, YValue
   Line Input #FileNo, XValue
   ' assign YValue to Y-axis and
   ' XValue to X-axis
Next

'Close file
Close #FileNo
0
 

Expert Comment

by:TT
ID: 2686072
Correction :
   Line Input #FileNo, XValue
   Line Input #FileNo, YValue
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2687047
for 10 points?

M
0
 

Author Comment

by:rudrasan
ID: 2687058
HI TT I LIKE YOUR LINES OF CODE HOWEVER
I READ TRHOUGH THE TEXT FILE LIKE THIS

DIM X1 AS INTEGER,Y1 AS INTEGER,X2 AS INTEGER,Y2 AS INTEGER,X3 AS INTEGER,Y3 AS INTEGER,X4 AS INTEGER,Y4 AS INTEGER
FILE=FREEFILE
OPEN "C:\MYTEXT.TEXT" FOR INPUT AS FILE
DO WHILE NOT EOF(FILE)
INPUT #FILE, X1,Y1,X2,Y2,X3,Y3,X4,Y4
LOOP
CLOSE #FILE
for i = 1 to 8 step 1
mschart.data=x1
mschart.data=y1 etc!
USUALLY WHEN I ASSIGN AN ARRAY LIKE
MYARRAY(1 TO 8) AS INTEGER THEN PLOT ON MSCHART CONTROL IT WORKS FINE
MSCHART1.CHARTDATA=MYARRAY or it works
fine with
mschart.data=x1
mschart.data=y1 etc
BUT IT ONLY PLOTS 8 VARIABLES SO I GET 8 DATA POINTS WHICH IS FINE IF YOU WANT TO KNOW THE VALUES OF THE DATA YOU ENTERED BUT I WOULD LIKE X1 VERSUS Y1 AND SO ON. how can i assign variables and plot using either a picturebox control or mschart control. i really need help in the graphing section!!
thanking you in advance
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month10 days, 2 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question