|
-
Nov 3rd, 2001, 12:58 PM
#1
Thread Starter
Addicted Member
Diagram
How can i make a line-diagram?
[In time of development time stands still]
-
Nov 3rd, 2001, 01:11 PM
#2
Frenzied Member
Hum what do you mean? What's the diagram for? Could you explain a bit more please?
-
Nov 3rd, 2001, 01:22 PM
#3
Thread Starter
Addicted Member
I have a number of values which i want to show in a more exciting way...
[In time of development time stands still]
-
Nov 3rd, 2001, 02:02 PM
#4
-
Nov 5th, 2001, 02:32 AM
#5
Thread Starter
Addicted Member
I store them in an array
[In time of development time stands still]
-
Nov 5th, 2001, 11:43 AM
#6
-
Nov 5th, 2001, 12:59 PM
#7
Thread Starter
Addicted Member
Yeah, values is only 0-24.
[In time of development time stands still]
-
Nov 5th, 2001, 01:08 PM
#8
Frenzied Member
Cool 
Here's the code. It loops trough all the elements in the array except for the last one, and draws a line between this element and the next one 
(Here, X represents the index of each element, and Y represents the value of each element)
VB Code:
For i = 0 to UBound(TheValues)-1
Form1.Line (i*15,TheValues(i)*15)-((i+1)*15,TheValues(i+1)*15)
Next i
The size of the grid, in this case, is 15 (pixels or twips, it depends on the ScaleMode of the form), but you can change that value if you want
-
Nov 5th, 2001, 01:21 PM
#9
Thread Starter
Addicted Member
Is there any way to color it? Fill the diagram i mean.
[In time of development time stands still]
-
Nov 5th, 2001, 01:25 PM
#10
Frenzied Member
No, I'm afraid that would be a bit hard unless you're familiar with the Windows API
-
Nov 5th, 2001, 01:28 PM
#11
Thread Starter
Addicted Member
Uhh, just the basics, i know how to use API. What API call should i use?
[In time of development time stands still]
-
Nov 5th, 2001, 01:32 PM
#12
-
Nov 5th, 2001, 01:37 PM
#13
Thread Starter
Addicted Member
Public Declare Function ExtFloodFill Lib "gdi32" Alias "ExtFloodFill" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long, ByVal wFillType As Long) As Long
This? There is a FloodFill API call to, but it look almost the same.
Thanks, think i'm going to mess around a bit with this.
[In time of development time stands still]
-
Nov 5th, 2001, 01:48 PM
#14
-
Nov 8th, 2001, 05:41 PM
#15
Frenzied Member
Yes, but that wouldn't draw a filled graph unless it was made with columns
-
Nov 8th, 2001, 07:00 PM
#16
Ah, I didnt read through the entire thread. This is a line graph =).
Z.
-
Nov 8th, 2001, 10:51 PM
#17
VB also has controls for graphing - MSChart is really high end powered and does 3D renderings. High memory usage too.
DataGrid is another. If you must do a lot of graphs or change it constantly like in showinf %use of a channel, these are easier to program.
-
Nov 9th, 2001, 06:19 AM
#18
Thread Starter
Addicted Member
What's MSChart, and DataGrid?
[In time of development time stands still]
-
Nov 9th, 2001, 12:34 PM
#19
Thread Starter
Addicted Member
Ohh, found MSChart, but how do you use it?
[In time of development time stands still]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|