Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 10th, 2003, 03:38 AM
Authorized User
 
Join Date: Jun 2003
Location: Crowland, Lincs, United Kingdom.
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default MSChart - Populating Data

:( Help me please..
Any one knows the best way of populating the data into the MSChart in the VB6. I use many way but can not find effective way, prob don't know how to use it correctly.

1. By .Datasource: I use recordset but the database design to fit the MSChart. I got this from google.
field 0 is row name, and field1 - field3 - col1 to col3 data, ie
rowname|col1|col2|Col3....
Jan | 10 | 20 | 40
Tue | 0 | 10 | 50
if you only want to display 1 col instead of 3 then just use col1
This method is best displays for me but I have to clear the table and put in the data first.. hence slow performance of the program.

2. By .ChartData: this area works faster, where you create an array object ie arrData. The array is 2 dimensional ie arrData(1 to 3,1 to 3), or arrData(1 to 3,1), where the first one is using 3 cols and the second one using 1.
This is good but, I unable to declare array size dynamically, and fixed size have to be declare, not good if your row data is too big for the array. Also if you declare ample size, ie 20, but if you have only for example 5 rows of data, you would not be able to see anything on the chart, hence array must be declare around the correct size with 1 or 2 over max.

Can any one help me .. thanks in advance.
Cheers
Kasie
Reply With Quote
  #2 (permalink)  
Old June 11th, 2003, 06:00 AM
Authorized User
 
Join Date: Jun 2003
Location: Goodlands, n/a, Mauritius.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to psychadelic
Default

Hello

you can use dynamic arrays instead. Try this as an example:

Code:
     
Private Sub Command1_Click()

    Dim iCol As Integer
    Dim iRow As Integer

    iCol = 3    'or anything you want
    iRow = 3    'or anything you want
    ReDim arrData(1 To iCol, 1 To iRow)
'   instead of Dim arrData(1 to 3, 1 to 3)

'   set your array and put your code here
    MSChart1.ChartData = arrData
    DoEvents
    MsgBox "Voila..."

End Sub
regards,

psychadelic
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating data in subforms michayos Infopath 0 May 25th, 2007 10:40 AM
WebShop: populating data from different db JoinTTT BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 April 7th, 2007 04:54 PM
populating cboBox with remote table data Loralee Access 8 October 31st, 2005 11:24 PM
MSChart : A chart that needs incomplete data point sanjib VB Components 0 February 22nd, 2005 03:33 AM
MSChart - Populating the chart kasie VB Components 0 June 10th, 2003 03:22 AM



All times are GMT -4. The time now is 01:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.