Olaf Doschke
Programmer
Tags and tagclouds are all over the internet. They are so useful, even Microsoft has discovered tag clouds for themselves and made Tagspace (
The useful thing is, you can see several orders at a time, first tags are alphabetically ordered, then their importance is shown by there size. Something a simple list or a grid can only display once at a time by ordering. You can even add one more property by using the saturation of the tags and then could also use the color for another property.
I just played around with the idea and jsut used size and saturation to display Northwind customers in a way you may never have seen before:
Bye, Olaf.
The useful thing is, you can see several orders at a time, first tags are alphabetically ordered, then their importance is shown by there size. Something a simple list or a grid can only display once at a time by ordering. You can even add one more property by using the saturation of the tags and then could also use the color for another property.
I just played around with the idea and jsut used size and saturation to display Northwind customers in a way you may never have seen before:
Code:
Local lnMaxbrightness, lnMaxFontsize, lnMinFontsize, lcHTML, lnCol
lnMaxbrightness=200
lnMaxFontsize=49
lnMinFontsize=7
Close Databases All
Open Database Home()+"Samples\Northwind\Northwind.dbc"
Select;
Customers.Companyname,;
CustomerStats.nOrders,;
Sum(Orderdetails.quantity * Orderdetails.unitprice * (1-Orderdetails.discount)) As nTotal,;
(CustomerStats.dTo-CustomerStats.dFrom+1) As nDays;
From;
Customers,orders,orderdetails,;
(Select;
Customerid,;
Count(*) As nOrders,;
Min(orderdate) As dFrom,;
Max(orderdate) As dTo;
From;
Orders;
Group By 1;
) As CustomerStats;
Group By Companyname,nOrders,nDays;
Order By Companyname;
Where Customers.Customerid = CustomerStats.Customerid;
and Orders.Customerid = Customers.Customerid;
and Orders.Orderid = Orderdetails.Orderid;
Into Cursor curCustomers nofilter
Select;
Max(nTotal/nOrders) As nMaxAverageOrders,;
Max(nTotal/nDays) As nMaxAverageTotal;
From curCustomers;
Into Cursor curMax
lcHTML = ""
Select curCustomers
Scan
lnCol = Int(Mton(curCustomers.nTotal/curCustomers.nDays/curMax.nMaxAverageTotal*lnMaxbrightness))
TEXT to lcHTML additive Textmerge Noshow
<a style="font-size:<<Int(Mton(curCustomers.nTotal/curCustomers.nOrders/curMax.nMaxAverageOrders*(lnMaxFontsize-lnMinfontsize)+lnMinfontsize+.5))>>pt;
color:#<<Right(Transform(65793*(lnMaxBrightness-lnCol),"@0"),6)>>;"><<curCustomers.Companyname>></a>
ENDTEXT
EndScan
Local lcFile
lcFile = Addbs(GetEnv("TEMP"))+Sys(2015)+".html"
Strtofile("<html><body>"+lcHTML+"</body></html>",lcFile)
o = CreateObject("internetexplorer.application")
o.navigate2("file://"+lcFile)
o.Visible = .T.
Bye, Olaf.