Home > Domino Tips > Developer > Creating a column color chart on a Web page using LotusScript
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

LOTUSSCRIPT

Creating a column color chart on a Web page using LotusScript


Thomas Adrian
08.08.2006
Rating: -4.35- (out of 5) Hall of fame tip of the month winner


Lotus Notes and Domino tips, tutorials and how-to articles
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Adding this LotusScript code to an agent will create a simple column chart on a Web page using divs. The script generates random colors and values, so you may need to provide your own values if you want further customization.

You can see a demo here: http://www.notessidan.se/A55B53/blogg.nsf/pixel?Openagent

Sub Initialize
 
Dim session As New notessession,db 
As notesdatabase,doc As notesdocument 
Dim i As Integer, 
x As Integer,y As Integer, z As Integer,
h As Integer,v As Integer, s As Integer,
t As Integer
 
Print "<style css>"
Print |.frame{position:absolute;z-index:100;
background-color:white;
border-left:1px;border-right:1px;border-top:0px;
border-bottom:0px;
border-color:black;border-style:solid;width:500px;
height:300px;top:50px;left:50px;}|
Print |.stapel{position:absolute;z-index:10;
border-left:1px;border-right:1px;
border-top:1px;border-bottom:1px;
border-color:black;border-style:solid;
font-family:verdana;font-size:10px;text-align:center;
bottom:0px;width:30px}|
Print |.month {position:absolute;z-index:10;
border:0px;border-color:black;
border-style:solid;font-family:verdana;
font-size:10px;text-align:center;
background-color:white;bottom:-25px;
width:30px;height:20px}|
Print | .left {position:absolute;z-index:-100px;
border-top:0px;border-left:0px;
padding:0px;border-right:0px;
border-bottom:1px;border-color:black;
border-style:solid;font-family:verdana;
font-size:10px;text-align:left;
background-color:none;left:-30px;
width:530px;height:20px}|
Print "</style>"
 
v = 10
Print |<div class=frame>|
For i = 1 To 12
 h = Int(Rnd * 300) 
 x = Int(Rnd * 256) 
 y = Int(Rnd * 256) 
 z = Int(Rnd * 256) 
 Print |<div class=stapel title=
"| + mo(i) + |: | + Cstr(h) + |" 
style=background-color:rgb
(|Cstr(x)|,| + Cstr(y) + |,| + Cstr(z) + |);left:| + 
Cstr(v) + |px;height:| + Cstr(h) + |px>| 
+ Cstr(h) + |</div>|
Print |<div class=month style=left:| 
+ Cstr(v) + 
|px;>| + mo(i) + |</div>|  
v = 40*i + 10
Next 
 
t = 0
For s = 1 To 4
Print |<div class=left style=bottom:| 
+ Cstr(t) + |>| + Cstr(t) + |</div>|  
t = 100*s
Next
Print |</div>|
End Sub

Function mo(no As Integer) As String
 
Select Case no
Case 1:mo = "Jan"
Case 2:mo = "Feb"
Case 3:mo = "Mar"
Case 4:mo = "Apr"
Case 5:mo = "May"
Case 6:mo = "Jun"
Case 7:mo = "Jul"
Case 8:mo = "Aug"
Case 9:mo = "Sep"
Case 10:mo = "Okt"
Case 11:mo = "Nov"
Case 12:mo = "Dec"
End Select
 
End Function

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Thomas Adrian. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
LotusScript
LotusScript agent parses ACL to Microsoft Notepad
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
Run or restart Notes/Domino agents via text messages
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management

LotusScript
LotusScript agent parses ACL to Microsoft Notepad
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication

Agent
Run or restart Notes/Domino agents via text messages
Approve Lotus Notes documents using a BlackBerry mobile device
LotusScript agent indexes Lotus Notes/Domino databases
Open documents in Lotus Notes from the Web without a UNID
Fix and update Lotus Notes documents with limited access
Verify scheduled agent status with Domino Extensible Language (DXL)
How to export data from a Lotus Notes database to a CSV file
Enable or disable scheduled agents without opening the Lotus Notes database design
Creating custom views in Lotus Notes databases
Editing fields in a Lotus Notes view with Ajax

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts