forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Bar Chart with no DLL
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Jan 19, 2005 5:26 am    Post subject: Bar Chart with no DLL Reply with quote

A simple bar chart using text elements:
Code:

OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE "By Mac"
DIALOG CREATE,"Bar Chart Example",-1,0,260,230
  DIALOG ADD,STYLE,S1,MS Sans Serif,10
  DIALOG ADD,STYLE,Black,,,,BLACK
  DIALOG ADD,STYLE,White,,,,WHITE
  DIALOG ADD,STYLE,Red,,,,RED
  DIALOG ADD,STYLE,Green,,,,LTGREEN
  DIALOG ADD,STYLE,Blue,,,,LTBLUE

  DIALOG ADD,EDIT,E1,5,205,50,24,"40",,S1
  DIALOG ADD,EDIT,E2,35,205,50,24,"90",,S1
  DIALOG ADD,EDIT,E3,65,205,50,24,"70",,S1

  DIALOG ADD,BUTTON,Set,95,205,50,24,,,S1
  DIALOG ADD,BUTTON,Clear,125,205,50,24,,,S1

  rem -- background --
  DIALOG ADD,TEXT,BG,0,0,200,200,"",,,White

  rem -- horz lines --
  %x = 0
  REPEAT
    DIALOG ADD,TEXT,Line_x%x,@prod(%x, 10),0,200,1,"",,Black
    %x = @succ(%x)
  UNTIL @greater(%x, 20)

  rem -- vert lines --
  %x = 0
  REPEAT
    DIALOG ADD,TEXT,Line_y%x,0,@prod(%x, 10),1,200,"",,Black
    %x = @succ(%x)
  UNTIL @greater(%x, 20)

  DIALOG ADD,TEXT,Bar1,200,10,40,1,"",,Red
  DIALOG ADD,TEXT,Bar2,200,80,40,1,"",,Green
  DIALOG ADD,TEXT,Bar3,200,150,40,1,"",,Blue

  DIALOG ADD,STATUS,Stat,"Enter percentages and press ''Set''."
DIALOG SHOW

:EVLOOP
  WAIT EVENT
  goto @event()

:SetBUTTON
  %%bar1 = @dlgtext(E1)
  %%bar2 = @dlgtext(E2)
  %%bar3 = @dlgtext(E3)
  if @both(@greater(%%bar1, 0), @greater(101, %%bar1))
     DIALOG SETPOS,Bar1,@diff(200, @prod(%%bar1, 2)),,,@prod(%%bar1, 2)
  end
  if @both(@greater(%%bar2, 0), @greater(101, %%bar2))
     DIALOG SETPOS,Bar2,@diff(200, @prod(%%bar2, 2)),,,@prod(%%bar2, 2)
  end
  if @both(@greater(%%bar3, 0), @greater(101, %%bar3))
     DIALOG SETPOS,Bar3,@diff(200, @prod(%%bar3, 2)),,,@prod(%%bar3, 2)
  end
  goto EVLOOP

:ClearBUTTON
  rem -- reset bar positions --
  DIALOG SETPOS,Bar1,200,,,1
  DIALOG SETPOS,Bar2,200,,,1
  DIALOG SETPOS,Bar3,200,,,1
  goto EVLOOP

:CLOSE
  EXIT

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Jan 19, 2005 7:49 am    Post subject: Reply with quote

thanks mac, will check it out later on tonight my time

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Wed Jan 19, 2005 1:22 pm    Post subject: Reply with quote

Nice little example - could be helpful.
_________________
Joe Floyd
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Jan 19, 2005 1:38 pm    Post subject: Reply with quote

nice job mac Smile

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sat Jan 22, 2005 4:25 am    Post subject: Reply with quote

Cool Smile
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Sat Jan 22, 2005 7:31 am    Post subject: Reply with quote

Coolio, Mac! Cool
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue Jan 25, 2005 3:44 pm    Post subject: Reply with quote

Thought you'd like to see the bandscope program I made using this example. The program talks to my ham radio transceiver and sweeps it across a 100KHz width of the radio spectrum, and plots the signal strength across the spectrum. It's going to be really handy keeping watch for rare openings on normally quiet bands.


_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Tue Jan 25, 2005 3:52 pm    Post subject: Reply with quote

Neat!
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Jan 25, 2005 10:20 pm    Post subject: Reply with quote

Nice job Jules. Wink

Here's a coupla shots of a futures charting app I converted
to VDS 3 using text elements - had coded it in VDS 2 with
bitmaps - and that was converted from the original DOS
C++ version I wrote several (lol, many?) years ago...

Chart1 shows pure text elements (including the grid) and
Chart2 uses VDSug.dll drawing routines to chart highs
and lows from the same data.

Pics aren't the greatest, was trying to keep 'em small. Confused





Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Jan 26, 2005 7:48 am    Post subject: Reply with quote

looks great mac, i am puzzled as to how you did it all Confused

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Wed Jan 26, 2005 9:03 am    Post subject: Reply with quote

Those charts look really impressive.

A couple of advantages I discovered using text elements for my app: I can set tooltips for each bar to display the exact value. You couldn't do that using a charting element. I also use the click events for each bar, so if you click on one, the app tunes the radio to that frequency.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Jan 26, 2005 6:46 pm    Post subject: Reply with quote

Jules,

Thanks. You're right - the fact ya can store info in the text
elements is a definite plus. The futures chart elements also
store data for each day, and display that day's data when
ya click it. The info displayed in the pic is from clicking on
the last day shown in the chart (that's March 2005 wheat
btw). No tooltips in VDS 3 though. Wink

Serge,

Thanks - it's a mathematical nightmare... Not only does
it grab data from over a years worth of files and turn the
figures into pixel XY info, it must also do a scaling routine
to fit the data on the display area, since price ranges can
vary greatly from one commodity to another.

The little short blue lines at the bottom are for weekdays
that have no valid data - most are holidays, but ya get
one occasionally when there's corrupted data in a file.

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Jan 27, 2005 12:29 am    Post subject: Reply with quote

i figured it would be a mathematical nightmare as i did something like this a long time ago in a different language and what a a mind bender it was

you have done a great job with it Smile

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Feb 10, 2005 10:32 pm    Post subject: Reply with quote

I have to say I'm highly impressed. Thumbs Up
Any chance you can provide example code for that? Very Happy

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Feb 10, 2005 11:03 pm    Post subject: Reply with quote

Sorry FF, but that app is not open source. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group