For the last week I have been messying around with some simple graphing code, the link is in my sig.
The graph can plot many datasets. A dataset is just a collection of values. This means that you can plot numerous graphs on the same graph. Does that make sense.
This isn't just a simple graphing tool. it can be used to 100% replicated the graphic equalizer music thingy from media player and the moving graphs that you see in task manager.
Anyways. If you download the zip and run Test.vpg and click the Music button you will see the media player demo.
Notice how the little blue "caps", I call them caps as I don't know what they are really called, are still visible when their value is 0.
This looks silly. I can change this by setting the value < 0 so it appears off the graph, and therefore doesn't get drawn. Another method would to have these points as the 1st dataset, and the green bars would then paint over these "caps".
I don't like either method. Anyone got any suggestions?
How about setting an upper and lower limit, bit like in stats, and any values outside these limits don't get drawn?
Or having a visible property on a Point object?
The next thing is slightly releated. If I am displaying 2 datasets that both show bars then how should I draw these? The largest bar at the back and smallest at the front? On top of each other? How? This I really don't have a clue about at this moment in time, although it's not 100% important, unlike my 1st problem.
Any other suggestions would be greatful.
Woof
PS U need to have VB6 to run this directly. If you don't then you have to manually edit the class files for it to run in VB5.
for bar charts, I was thinking more like
bar(dataset1) - 2 pixels - bar(dataset2) - 7 pixels - bar(dataset1) - 2 pixels - bar(dataset2) - 7 pixels --> etc.
with the bar(dataset2) being a different color than ds1
I have an array of doubles that looks like this:
XUnMedio(10) = 0.0009765625
XUnMedio(11) = 0.001953125
XUnMedio(12) = 0.00390625
XUnMedio(13) = 0.0078125
XUnMedio(14) = 0.015625
XUnMedio(15) = 0.03125
XUnMedio(16) = 0.0625
XUnMedio(17) = 0.125
XUnMedio(18) = 0.25
XUnMedio(19) = 0.5
XUnMedio(20) = 0.75
So, I want a graph that shows those values in the position of the array. I would like to know if it is possible to add numbers to your axis and if so, how? And how would I get all the data?
I can see you use a dataset you created but I would like to see an example with the labels... Could you please help me?
Thanks in advance.
Last edited by Tec-Nico; Nov 2nd, 2004 at 09:23 PM.
We miss you, friend... Rest in Peace, we will take care of the rest of it.
[vbcode]
On Error Me.Fault = False
[/vbcode]
- Silence is the human way to share ignorance
Tec-Nico
Originally posted by Wokawidget The next thing is slightly releated. If I am displaying 2 datasets that both show bars then how should I draw these? The largest bar at the back and smallest at the front? On top of each other? How? This I really don't have a clue about at this moment in time, although it's not 100% important, unlike my 1st problem.
Any other suggestions would be greatful.
Woof
You need to have the same baseline if your comparing both bars so stacking them is not a good idea in that case. Stacking is applicable if your graphing say the number of students in a class, bar 1 for boys bar 2 for girls, so you'll see the gender composition of each class bar aside from seeing which sections have few students.
For the case with the same baseline, a 2D graph is not advisable. You won't be able to distinguish between case of one bar being zero and another case wherein both bars are equal. You need a 3D graph for that.
Last edited by leinad31; Nov 3rd, 2004 at 02:23 AM.