REVO2700 5 wgChart c {b wgChart U Lucida Grande U Lucida Grande U Lucida Grande U Lucida Grande W Lucida Grande W Arial W Arial W Arial U Arial W Lucida Grande U Lucida Grande U Lucida Grande U Lucida Grande cREVOnline cGlxGeneral tabstops 662,4000dirty falsevarChecking falsescroll 0object name wgChart parent stack wgChartchunk char 840 to 854 of field 1immed stack wgChartcMotif Alabaster cLinkMode false cConsNo CompilesForSave 1CompilesForArchive 4 cGlx2General CompilesForSave 3id 1185571627197 cREVGeometryCache stackID 13798 cREVGeneral bookmarks debugObjects 1button id 2338 of card id 1002 of stack "wgChart"handlerList breakpoints prevHandler tempScript stackfileversion 2.7script @ b cREVGeometryCacheIDs 91181852190444 37731182884611538 51031182891465510 56031182887495019 54291182887495020 54301181775993823 28001181775999877 28021179358164668 10041181853871501 40041181850572480 36541181850572479 36531182884625472 51061181930077016 41421181776818923 29111181770967663 27031182890583361 55641181852421025 37891179361831026 10331181930066014 41411182890583362 55651181852421026 37901181932949998 46161181852087192 37721181851580294 36941181851580295 36951181850843280 36571181930021492 41391181850843281 36581181776868885 29121242425731946 137901181778574612 10051242425731951 137911182884729804 50991182884729805 51001242425731953 137921181770518980 26771181776309025 28351242425731955 137931181928968213 40661242425731957 137941242425731959 137951242425731961 137961181929959557 41381242425731963 137971181932747959 46151181776367480 28031242425731965 137981181772598952 27901182885128230 51071182885128231 51081181772649131 27911181775875244 27961181772649132 27921182884611535 50971182884611536 51011182893311917 60251182884611537 5102 cREVGeometrycache order total 57 cREVGeneral bookmarks handlerList prevHandler tempScript script u _ ` E F I J n o * + - . 5 6 %P @ b cGlxGeneral object name card id 9552 parent stack wgChartimmed stack wgCharthilitedLine 1props
6basics
preview
-
blendLevel 0
-
ID 9552
name card id 9552
number 2
-
foregroundColor 0,0,0 [inherited]
backgroundColor white [inherited]
-
borderWidth 2
cantDelete false
-
4border
4colors
4patterns
4position
4size
4text
4custom [main]
4custom [cGlxGeneral]
4custom [cREVGeometrycache]
4custom [cREVGeometryCacheIDs]
4miscellaneous
4global props
4global vars
scroll 282 cREVGeometryCacheIDs 1183485593665 95571183476487505 9554 cREVGeometrycache order total 2 %R %U u ChartBgColor u on mouseUp put the long id of group "wgChart" of this card into tChart set the cChartBgColor of tChart to the selectedText of me send "makeChart" to tChart end mouseUp C f ] transparent transparent white black gray cREVGeneral scriptChecksum &l28%b4YrevUniqueID 1181770518980 bookmarks handlerList mouseUptempScript prevHandler mouseUpscriptSelection char 173 to 172script Kon mouseUp
put the long id of group "wgChart" of this card into tChart
set the cChartBgColor of tChart to the selectedText of me
send "makeChart" to tChart
end mouseUp
ChartType u on mouseUp put the long id of group "wgChart" of this card into tChart set the cChartType of tChart to the selectedText of me send "makeChart" to tChart end mouseUp ) B ? bar pie bar cREVGeneral scriptChecksum 6X# bookmarks revUniqueID 1181770967663handlerList mouseUpscriptSelection char 91 to 90prevHandler mouseUptempScript script @on mouseUp
put the long id of group "wgChart" of this card into tChart
set the cChartType of tChart to the selectedText of me
send "makeChart" to tChart
end mouseUp
ChartBgColor Label E d cREVTable currentview Bg Color: cREVGeneral revUniqueID 1181772598952 Bg Color: LegendBgColor Label |G h cREVTable currentview Bg Color: cREVGeneral revUniqueID 1181772649131 Bg Color: LegendBgColor u on mouseUp put the long id of group "wgChart" of this card into tChart set the cLegendBgColor of tChart to the selectedText of me send "makeChart" to tChart end mouseUp G f Y transparent transparent white black gray cREVGeneral scriptChecksum OlK.J bookmarks revUniqueID 1181772649132handlerList mouseUpscriptSelection char 173 to 172prevHandler mouseUptempScript script Don mouseUp
put the long id of group "wgChart" of this card into tChart
set the cLegendBgColor of tChart to the selectedText of me
send "makeChart" to tChart
end mouseUp
Type Label + N cREVTable currentview Type: cREVGeneral revUniqueID 1181775875244 Type: Legend Visible Label H cREVTable currentview Display: cREVGeneral revUniqueID 1181776309025 Display: Legend On-Off iEon mouseUp put the long id of group "wgChart" of this card into tChart if the hilite of btn "Legend On" then set the cShowLegend of tChart to 1 send "makeChart" to tChart -- needed to get legend formatted for sizing else set the cShowLegend of tChart to 0 end if send "makeChart" to tChart end mouseUp q ' cREVGeneral scriptChecksum `Ӹr\revUniqueID 1181776367480 bookmarks handlerList mouseUptempScript prevHandler mouseUpscriptSelection char 225 to 224scripton mouseUp
put the long id of group "wgChart" of this card into tChart
if the hilite of btn "Legend On" then
set the cShowLegend of tChart to 1
send "makeChart" to tChart -- needed to get legend formatted for sizing
else
set the cShowLegend of tChart to 0
end if
send "makeChart" to tChart
end mouseUp
Display On/Off i i cREVGeneral revUniqueID 1181852190444 bookmarks handlerList tempScript prevHandler script Legend On `d 2 On cREVGeneral revUniqueID 1181775993823 Legend Off `d 6 Off cREVGeneral revUniqueID 1181775999877 _ Legend FontSize Label |, h cREVTable currentview Font Size: cREVGeneral revUniqueID 1181776818923 Font Size: ` LegendFontSize u on mouseUp put the long id of group "wgChart" of this card into tChart set the cLegendFontSize of tChart to the selectedText of me send "makeChart" to tChart end mouseUp . 6 X 10 9 10 11 12 cREVGeneral scriptChecksum {)(UW revUniqueID 1181776868885 bookmarks handlerList mouseUptempScript prevHandler mouseUpscriptSelection char 86 to 85script Eon mouseUp
put the long id of group "wgChart" of this card into tChart
set the cLegendFontSize of tChart to the selectedText of me
send "makeChart" to tChart
end mouseUp
E ChartOutlineColor Label n { u cREVTable currentview Part Outline Color: cREVGeneral revUniqueID 1181850572479 Part Outline Color: F ChartOutlineColor u on mouseUp put the long id of group "wgChart" of this card into tChart set the cPartOutlineColor of tChart to the selectedText of me send "makeChart" to tChart end mouseUp y f black white black gray cREVGeneral scriptChecksum lll'<*9 bookmarks revUniqueID 1181850572480handlerList mouseUpscriptSelection char 89 to 88prevHandler mouseUptempScript script Gon mouseUp
put the long id of group "wgChart" of this card into tChart
set the cPartOutlineColor of tChart to the selectedText of me
send "makeChart" to tChart
end mouseUp
I ChartOutlineSize Label v m cREVTable currentview Part Outline Size: cREVGeneral revUniqueID 1181850843280 Part Outline Size: J ChartOutlineSize u on mouseUp put the long id of group "wgChart" of this card into tChart set the cPartOutlineSize of tChart to the selectedText of me send "makeChart" to tChart end mouseUp 5 { 1 0 1 2 3 4 5 cREVGeneral scriptChecksum lp6(F[>AK1 revUniqueID 1181850843281 bookmarks handlerList mouseUptempScript prevHandler mouseUpscriptSelection char 89 to 88script Fon mouseUp
put the long id of group "wgChart" of this card into tChart
set the cPartOutlineSize of tChart to the selectedText of me
send "makeChart" to tChart
end mouseUp
n ChartMargin Label ` d cREVTable currentview Margin Size: cREVGeneral revUniqueID 1181851580294 Margin Size: o ChartMarginSize u on mouseUp put the long id of group "wgChart" of this card into tChart set the cChartMargin of tChart to the selectedText of me send "makeChart" to tChart end mouseUp ^ 5 _ 2 0 1 2 3 4 5 cGlxGeneral parent stack wgChartobject name ChartMarginSizeimmed stack wgCharthilitedLine 30props6basics
-
blendLevel 0
opaque true
-
default false
enabled true
style menu
-
showBorder true
borderWidth 2
showFocusBorder true
-
hilite false
autoHilite false
sharedHilite true
traversalOn false
-
ID 3695
label 1
name ChartMarginSize
number 10
showName true
-
menuLines 5
menuMode option
menuMouseButton 1
-
text 1...
tooltip [empty]
-
textAlign center
textColor 0,0,0 [inherited]
textFont Lucida Grande [inherited]
textSize 11 [inherited]
textStyle plain [inherited]
-
visible true
-
4borders
4colors
4formatting
4icons
4patterns
4position
4size
6text
-
text 1...
-
textAlign center
textFont Lucida Grande [inherited]
textSize 11 [inherited]
textStyle plain [inherited]
-
textColor 0,0,0 [inherited]
-
4custom [main]
4custom [cGlxGeneral]
4custom [cREVGeneral]
4miscellaneous
4global props
4global vars
scroll 285 cREVGeneral scriptChecksum xTNBSH,N_Y4 bookmarks revUniqueID 1181851580295handlerList mouseUpscriptSelection char 171 to 170prevHandler mouseUptempScript script Bon mouseUp
put the long id of group "wgChart" of this card into tChart
set the cChartMargin of tChart to the selectedText of me
send "makeChart" to tChart
end mouseUp
Legend Label H cREVTable currentview Legend Parameters cREVGeneral revUniqueID 1181852087192 Legend Parameters ChartBarGap Label ? cREVTable currentview Bar Gap: cREVGeneral revUniqueID 1181852421025 Bar Gap: ChartBarGap u on mouseUp put the long id of group "wgChart" of this card into tChart set the cBarGap of tChart to the selectedText of me send "makeChart" to tChart end mouseUp 5 5 0 1 5 10 20 cREVGeneral scriptChecksum b6ہ^`[ٓ bookmarks revUniqueID 1181852421026handlerList mouseUpscriptSelection char 166 to 165prevHandler mouseUptempScript script =on mouseUp
put the long id of group "wgChart" of this card into tChart
set the cBarGap of tChart to the selectedText of me
send "makeChart" to tChart
end mouseUp
PartColors Label d cREVTable currentview Color Scheme: cREVGeneral revUniqueID 1181853871501 Color Scheme: Color Scheme uon mouseUp put the long id of group "wgChart" of this card into tChart switch (the selectedText of me) case "Scheme 1" set the cPartColors of tChart to \ "#BC6AA1,#8450B2,#5350B2,#507EB2,#509DB2,#77B250,#AFC358,#C9C75D,#C9B15D,#C99C5D,#C9825D,#C06572" break case "Scheme 2" set the cPartColors of tChart to \ "#495EDB,#7C49DB,#C549DB,#DB497C,#E8683B,#E8933B,#E8B63B,#E8D83B,#D5E838,#A0D62A,#2AD6C3,#2A8BD6" break end switch send "makeChart" to tChart end mouseUp f Z Scheme 2 Scheme 1 Scheme 2 cREVGeneral scriptChecksum .\Ղ\3X5revUniqueID 1181928968213 bookmarks handlerList mouseUptempScript prevHandler mouseUpscriptSelection char 450 to 449script `on mouseUp
put the long id of group "wgChart" of this card into tChart
switch (the selectedText of me)
case "Scheme 1"
set the cPartColors of tChart to \
"#BC6AA1,#8450B2,#5350B2,#507EB2,#509DB2,#77B250,#AFC358,#C9C75D,#C9B15D,#C99C5D,#C9825D,#C06572"
break
case "Scheme 2"
set the cPartColors of tChart to \
"#495EDB,#7C49DB,#C549DB,#DB497C,#E8683B,#E8933B,#E8B63B,#E8D83B,#D5E838,#A0D62A,#2AD6C3,#2A8BD6"
break
end switch
send "makeChart" to tChart
end mouseUp
* Names Label d cREVTable currentview Data Names: cREVGeneral revUniqueID 1181929959557 Data Names: + Values Label d cREVTable currentview Data Values: cREVGeneral revUniqueID 1181930021492 Data Values: - Names )` o cCurrentObject Mstack "/Users/geobrakt/Documents/My Revolution Workspace/Widgets/wgChart.rev" cREVGeneral revUniqueID 1181930066014 @peach,apple,pumpkin,cherry,blueberry,rhubarb,mince,banana cream . Values )` o cCurrentObject Mstack "/Users/geobrakt/Documents/My Revolution Workspace/Widgets/wgChart.rev" cREVGeneral revUniqueID 1181930077016 4,30,19,12,3,15,23,17 Chart Label H cREVTable currentview Chart Parameters cREVGeneral revUniqueID 1181932747959 Chart Parameters Data Label H cREVTable currentview Data cREVGeneral revUniqueID 1181932949998 Data Grid Visible Label y > cREVTable currentview Display: cREVGeneral revUniqueID 1182884611535 Display: Grid On/Off i on mouseUp put the long id of group "wgChart" of this card into tChart if the hilite of btn "Grid On" then set the cShowGrid of tChart to 1 else set the cShowGrid of tChart to 0 end if send "makeChart" to tChart end mouseUp v i cREVGeneral scriptChecksum I57UR^ғ bookmarks revUniqueID 1182884729804handlerList mouseUpscriptSelection char 1 to 0prevHandler tempScript scripton mouseUp
put the long id of group "wgChart" of this card into tChart
if the hilite of btn "Grid On" then
set the cShowGrid of tChart to 1
else
set the cShowGrid of tChart to 0
end if
send "makeChart" to tChart
end mouseUp
Grid On `d z 2 On cREVGeneral revUniqueID 1182884729805 Grid Off `d z 6 Off cREVGeneral revUniqueID 1182884611536 Grid Color Label h cREVTable currentview Grid Color: cREVGeneral revUniqueID 1182884611537 Grid Color: GridColor u on mouseUp put the long id of group "wgChart" of this card into tChart set the cGridColor of tChart to the selectedText of me send "makeChart" to tChart end mouseUp f F white #black white blue red green #FFCC00 cGlx2General cScriptChecksum cExplicitVariables cHscrollScript 0cLocals cHscrollHandlers 0cSelectedChunk char 189 to 188cHtmlScript E1!{^/"/v 'ٱwnp)!B[7F Ώj:IʁH'&¾=vFbw tE%I[1'+G'ͼBٽz:ɵ(q+ cHandlersListWidth 125cConstants cHtmlHandlers b )I). EɶJƆƖJv6 qĜļԢb}B;.;5eKk4f&pũ ɯsi cDirtyFlag false cFolders all handlers cHandlers mouseUpcVscrollScript 0cVscrollHandlers 0 cHilitedLine 2 cGlobals cGlx2TimeStamp checksum ).J QET1242404136 end1242404094 start cREVGeneral revUniqueID 1182884611538 Grid Label H f cREVTable currentview Grid Parameters cREVGeneral revUniqueID 1182884625472 Grid Parameters Grid Div Size Label h cGlxGeneral parent stack wgChartobject name Grid Div Size Labelimmed stack wgCharthilitedLine 29props A6basics
preview
-
blendLevel 0
opaque false
-
autoTab false
dontWrap true
-
enabled true
showBorder false
showFocusBorder true
style transparent
-
hScrollBar false
vScrollBar false
-
autoHilite false
lockText true
traversalOn false
-
ID 5107
name Grid Div Size Label
number 22
owner card id 1002
-
margins 8
-
text Division Size:
sharedText true
tooltip [empty]
-
visible true
-
4borders
4colors
4formatting
4lists
4patterns
4position
4size
4text
4custom [main]
4custom [cGlxGeneral]
4custom [cREVGeneral]
4custom [cREVTable]
4miscellaneous
4global props
4global vars
scroll 238 cREVTable currentview Unit Size: cREVGeneral revUniqueID 1182885128230 Division Size: GridDivSize u ON mouseUp put the long id of group "wgChart" of this card into tChart set the cDivSize of tChart to the selectedtext of me send "makeChart" to tChart END mouseUp 6 D 5 5 10 15 20 cGlxGeneral tabstops 662,4000 checksum VT`JIdirty falsevarChecking false handler_line 1scroll 200object name GridDivSizecMotif Alabaster handlersmouseUp
codeON mouseUp
put the long id of group "wgChart" of this card into tChart
set the cDivSize of tChart to the selectedtext of me
send "makeChart" to tChart
END mouseUp
hilitedLine 22handler_scroll 0props6basics
preview
-
blendLevel 0
opaque true
-
default false
enabled true
style menu
-
showBorder true
borderWidth 2
showFocusBorder true
-
hilite false
autoHilite false
sharedHilite true
traversalOn false
-
ID 5108
label 5
name GridDivSize
number 14
showName true
-
menuLines 5
menuMode option
menuMouseButton 1
-
text 5...
tooltip [empty]
-
textAlign center
textColor 0,0,0 [inherited]
textFont Lucida Grande [inherited]
textSize 11 [inherited]
textStyle plain [inherited]
-
visible true
-
4borders
4colors
4formatting
4icons
4patterns
4position
4size
4text
4custom [main]
4custom [cGlxGeneral]
4custom [cREVGeneral]
4miscellaneous
4global props
4global vars
parent stack wgChartchunk char 88 to 87 of field 5immed stack wgChart cLinkMode false cREVGeneral scriptChecksum gaމ"z=̀handlerList mouseUpbreakpoints scriptSelection char 86 to 85revUniqueID 1182885128231 bookmarks tempScript prevHandler mouseUpscript ?on mouseUp
put the long id of group "wgChart" of this card into tChart
set the cUnitSize of tChart to the selectedText of me
send "makeChart" to tChart
end mouseUp
5 Grid Unit Stress Label h cREVTable currentview Stress Every: cREVGeneral revUniqueID 1182887495019 Stress Every: 6 GridStressSize u ON mouseUp put the long id of group "wgChart" of this card into tChart set the cDivStress of tChart to the selectedtext of me send "makeChart" to tChart END mouseUp 6 0 0 2 3 5 cGlxGeneral tabstops 662,4000 handlersmouseUp
checksum ek&CaAcodeON mouseUp
put the long id of group "wgChart" of this card into tChart
set the cDivStress of tChart to the selectedtext of me
send "makeChart" to tChart
END mouseUp
dirty falsehandler_scroll 0varChecking false handler_line 1scroll 0object name GridStressSize parent stack wgChartchunk char 84 to 93 of field 5immed stack wgChartcMotif Alabaster cLinkMode false cREVGeneral scriptChecksum t]pTXQJq:DhandlerList mouseUpbreakpoints scriptSelection char 173 to 172 bookmarks revUniqueID 1182887495020prevHandler mouseUptempScript script Aon mouseUp
put the long id of group "wgChart" of this card into tChart
set the cStressUnit of tChart to the selectedText of me
send "makeChart" to tChart
end mouseUp
ChartOrientation uMON mouseUp put the long id of group "wgChart" of this card into tChart SWITCH (the selectedtext of me) CASE "Horizontal" set the cChartRect of tChart to "24,20,365,264" break CASE "Vertical" set the cChartRect of tChart to "24,20,326,380" break END SWITCH send "makeChart" to tChart END mouseUp f Vertical Horizontal Vertical cGlxGeneral tabstops 662,4000 handlersmouseUp
codeON mouseUp
put the long id of group "wgChart" of this card into tChart
SWITCH (the selectedtext of me)
CASE "Horizontal"
set the cChartRect of tChart to "24,20,365,264"
break
CASE "Vertical"
set the cChartRect of tChart to "24,20,326,380"
break
END SWITCH
send "makeChart" to tChart
END mouseUp
checksum o&R$Gؿhandler_scroll 0dirty false handler_line 1varChecking falsescroll 0 parent stack wgChartobject name ChartOrientationchunk char 278 to 277 of field 5cMotif Chalkboardimmed stack wgChart cLinkMode false cREVGeneral scriptChecksum / _YJ n :Zbreakpoints handlerList mouseUpscriptSelection char 1 to 0 bookmarks revUniqueID 1182890583361prevHandler mouseUptempScript scripton mouseUp
put the long id of group "wgChart" of this card into tChart
switch (the selectedText of me)
case "Horizontal"
set the cChartRect of tChart to "24,20,370,264"
break
case "Vertical"
set the cChartRect of tChart to "24,20,326,380"
break
end switch
send "makeChart" to tChart
end mouseUp
ChartOrientation Label R cREVTable currentview Orientation: cREVGeneral revUniqueID 1182890583362 Orientation: Draw Chart Mp on mouseUp put the long id of group "wgChart" of this card into tChart set the cPartNames of tChart to fld "Names" set the cPartValues of tChart to fld "Values" send "makeChart" to tChart end mouseUp 0 R B cREVGeneral scriptChecksum ԵjO:`v bookmarks revUniqueID 1182891465510handlerList mouseUpprevHandler tempScript scripton mouseUp
put the long id of group "wgChart" of this card into tChart
set the cPartNames of tChart to fld "Names"
set the cPartValues of tChart to fld "Values"
send "makeChart" to tChart
end mouseUp
Info B )on mouseUp go next card end mouseUp B 2 % F 4U uRIP creator gbrackett@luceatlux.com cConsLast prop hiliteHandlerScroll 0varChecking falseScriptChunk char 58 to 57 of field 93HandlerName mouseUp messageeditor both cREVGeneral scriptChecksum ^q ~,handlerList mouseUpbreakPoints scriptSelection char 1 to 0 bookmarks revUniqueID 1182893311917prevHandler mouseUptempScript script aon mouseUp
go next card
end mouseUp
wgChart i0DA--> all handlers on makeChart set the cMaxParts of me to 20 put the long id of me into tGroup if not okChartData() then exit makeChart put the cPartNames of tGroup into tNames put the cPartValues of tGroup into tValues -- Set up generic template object: set the filled of the templategraphic to true set the linesize of the templategraphic to the cPartOutlineSize of tGroup set the pencolor of the templategraphic to the cPartOutlineColor of tGroup set the locktext of field "Legend" of tGroup to true set the traversalon of field "Legend" of tGroup to false set the textsize of field "Legend" of tGroup to the cLegendFontSize of tGroup -- erase old chart repeat with tCounter = 1 to the cMaxParts of me if there is a grc ("chartPart" & tCounter) of tGroup then delete grc ("chartPart" & tCounter) of tGroup else exit REPEAT end if end REPEAT if there is an img "imgGrid" of tGroup then delete img "imgGrid" of tGroup end if if there is an img "tempGrid" then delete img "tempGrid" end if drawChart end makeChart on drawChart global gBgRect, gChartRect, gLegendRect put the long id of me into tGroup lock screen put the cPartColors of tGroup into tColors put the cPartNames of tGroup into tNames put the cPartValues of tGroup into tValues if the cChartBgColor of tGroup is "transparent" then set the opaque of btn "Background" of tGroup to "false" else set the opaque of btn "Background" of tGroup to "true" set the backgroundcolor of button "Background" of tGroup to the cChartBgColor of tGroup end if if the cLegendBgColor of tGroup is "transparent" then set the opaque of fld "Legend" of tGroup to "false" else set the opaque of fld "Legend" of tGroup to "true" set the backgroundcolor of fld "Legend" of tGroup to the cLegendBgColor of tGroup end if setChartRects set the rect of fld "Legend" of tGroup to gLegendRect put empty into field "Legend" of tGroup -- only empty it now, after sizing the rects -- do the drawing switch (the cChartType of tGroup) case "pie" set the visible of btn "Background" of tGroup to true set the rect of btn "Background" of tGroup to gBgRect put 0 into tCounter put empty into tNuObj -- adjust templategraphic set the rect of the templategraphic to gChartRect set the style of the templategraphic to "oval" -- find total put sum(tValues) into tTotal -- draw pie slices and complete legend repeat for each item tVal in tValues add 1 to tCounter if tNuObj is not empty then put tNuObj into tOldObj create grc in tGroup set the name of last grc to "chartPart" & tCounter put it into tNuObj if tCounter > 1 then put ((the startangle of tOldObj) + (the arcangle of tOldObj)) into lastAngle else put 0 into lastAngle end if if tCounter = (the number of items in tValues) then set the arcangle of tNuObj to 360 - lastAngle else set the arcangle of tNuObj to round( (360 * ( tVal/tTotal) ) ) end if set the startangle of tNuObj to lastAngle set the backgroundcolor of tNuObj to item tCounter of tColors -- Make legend entry: put " " & item tCounter of tNames into line tCounter of field "Legend" of tGroup if the cShowPercent of tGroup is true then put " (" & round(item tCounter of tValues * 100/tTotal) & "%)" after line tCounter of field "Legend" of tGroup else put " (" & item tCounter of tValues & ")" after line tCounter of field "Legend" of tGroup end if set the backgroundcolor of char 1 to 4 of line tCounter of field "Legend" of tGroup to item tCounter of tColors end REPEAT break case "bar" if the cResizing of me is false and the cShowGrid of tGroup > 0 then drawGrid set the visible of btn "Background" of tGroup to false put 0 into tCounter -- adjust templategraphic set the style of the templategraphic to "rectangle" -- size bar to fit background with cBarGap pixel gap put item 3 of gChartRect - item 1 of gChartRect into tChartWidth put item 4 of gChartRect - item 2 of gChartRect into tChartHeight put round(tChartWidth/(the number of items in tValues)) into tOffset -- horizontal space occupied by bar set the width of the templategraphic to tOffset - the cBarGap of tGroup -- find max put max(tValues) into tMaxValue -- draw bars repeat for each item tVal in tValues add 1 to tCounter create grc in tGroup set the name of last grc to "chartPart" & tCounter put it into tNuObj set the height of tNuObj to round( tVal * (tChartHeight)/tMaxValue) set the left of tNuObj to (item 1 of gChartRect) + (tCounter - 1) * tOffset + round(the cBarGap of tGroup /2) set the bottom of tNuObj to item 4 of gChartRect set the backgroundcolor of tNuObj to item tCounter of tColors set the tooltip of tNuObj to tVal -- Make legend entry: put " " & item tCounter of tNames into line tCounter of field "Legend" of tGroup set the backgroundcolor of char 1 to 4 of line tCounter of field "Legend" of tGroup to item tCounter of tColors end REPEAT if the cShowGrid of tGroup > 0 then if the cOrientation of me is "horizontal" then put "1 division = " & the cDivSize of tGroup into line tCounter + 1 of field "Legend" of tGroup else set the tabstops of field "Legend" of tGroup to the formattedwidth of field "Legend" of tGroup + 20 put tab & "1 division = " & the cDivSize of tGroup after line 1 of field "Legend" of tGroup end if end if break end SWITCH unlock screen end drawChart on drawGrid global gChartRect, gBgRect, gLegendRect put the long id of me into tGroup okGridData -- ensure that wgGrid properties are set properly lock screen create img "tempGrid" put gChartRect into tImgRect add 2 to item 4 of tImgRect -- move offscreen set the rect of img "tempGrid" to tImgRect if the cChartBgColor of tGroup is not "transparent" then choose bucket tool set the brushcolor to the cChartBgColor of tGroup click at the loc of img "tempGrid" end if choose line tool set the pencolor to the cGridColor of tGroup set the linesize to 1 put max(the cPartValues of tGroup) into tMaxValue put round(tMaxValue / the cDivSize of tGroup) + 1 into tNbRows put round(the cDivSize of tGroup * (item 4 of gChartRect - item 2 of gChartRect)/ tMaxValue) into tUnitHeight if tNbRows >= 1 then put the cStressUnit of tGroup into tStressUnit repeat with x = 1 to tNbRows -- draw up y from x axis put (item 4 of gChartRect - ((x-1) * tUnitHeight)) into tLineY if tStressUnit <> 0 and x mod tStressUnit = 1 then set the linesize to 2 else set the linesize to 1 end if drag from item 1 of gChartRect, tLineY to item 3 of gChartRect, tLineY end REPEAT end if set the showborder of img "tempGrid" to false copy img "tempGrid" to tGroup set the name of img "tempGrid" of tGroup to "imgGrid" delete img "tempGrid" if the cResizing of me is true then choose pointer tool set the selected of me to true else choose browse tool end if unlock screen end drawGrid on setChartRects global gBgRect, gChartRect, gLegendRect put the long id of me into tGroup -- set location and size of group elements put the cChartMargin of tGroup into tMargin put 6 into tOffset -- margin of group around items in the group put insetRect(the cChartRect of tGroup, tOffset) into gBgRect -- rect is left, top, right, bottom put (item 3 of gBgRect - item 1 of gBgRect ) into tBgWidth put (item 4 of gBgRect - item 2 of gBgRect) into tBgHeight -- now correct the rects if tBgWidth >= tBgHeight then set the cOrientation of me to "horizontal" put (the cShowLegend of tGroup) * (the formattedwidth of field "Legend" of tGroup) into tLegendWidth switch (the cChartType of tGroup) case "pie" put tBgWidth - tLegendWidth - 2*tMargin into tPieSize if ((tPieSize + 2*tMargin) > tBgHeight) then put tBgHeight - 2*tMargin into tPieSize end if put item 1 of gBgRect + tMargin into tPieLeft put item 2 of gBgRect + tMargin into tPieTop put tPieLeft + tPieSize into tPieRight put tPieTop + tPieSize into tPieBottom put tPieLeft, tPieTop, tPieRight, tPieBottom into gChartRect put item 3 of gBgRect - tLegendWidth, item 2 of gBgRect, item 3 of gBgRect, item 4 of gBgRect into gLegendRect if the cShowLegend of tGroup = 1 then -- not Bg behind legend subtract tLegendWidth from item 3 of gBgRect end if set the cBgRect of me to gBgRect -- center the pie put round (((item 3 of gBgRect - item 1 of gBgRect - 2*tMargin) - tPieSize)/2) into tShift add tShift to item 1 of gChartRect add tShift to item 3 of gChartRect put round(((item 4 of gBgRect - item 2 of gBgRect - 2*tMargin) - tPieSize)/2) into tShift add tShift to item 2 of gChartRect add tShift to item 4 of gChartRect break case "bar" if the cShowGrid of tGroup > 0 then -- adjust legend dimensions if necessary for unit spec put cr & "1 division = " & the cDivSize of tGroup after field "Legend" of tGroup end if put tBgWidth - tLegendWidth - 2*tMargin into tChartWidth -- create rectangular graph space put item 1 of gBgRect + tMargin, item 2 of gBgRect + tMargin, item 1 of gBgRect + tMargin + tChartWidth, \ item 4 of gBgRect - tMargin into gChartRect put item 1 of gBgRect + 2*tMargin + tChartWidth, item 2 of gBgRect + tMargin, \ item 3 of gBgRect, item 4 of gBgRect into gLegendRect break end SWITCH else -- vertical orientation set the cOrientation of me to "vertical" put (the cShowLegend of tGroup) * (the formattedheight of field "Legend" of tGroup) into tLegendHeight switch (the cChartType of tGroup) case "pie" put tBgHeight - tLegendHeight - 2*tMargin into tPieSize if ((tPieSize + 2*tMargin) > tBgWidth) then put tBgWidth - 2*tMargin into tPieSize end if put the cBgRect of me into gBgRect put item 1 of gBgRect + tMargin into tPieLeft put item 2 of gBgRect + tMargin into tPieTop put tPieLeft + tPieSize into tPieRight put tPieTop + tPieSize into tPieBottom put tPieLeft, tPieTop, tPieRight, tPieBottom into gChartRect put item 1 of gBgRect, item 4 of gBgRect - tLegendHeight, item 3 of gBgRect, item 4 of gBgRect into gLegendRect if the cShowLegend of tGroup = 1 then -- no Bg behind legend subtract tLegendHeight from item 4 of gBgRect end if # -- center the pie put round (((item 3 of gBgRect - item 1 of gBgRect - 2*tMargin) - tPieSize)/2) into tShift add tShift to item 1 of gChartRect add tShift to item 3 of gChartRect put round(((item 4 of gBgRect - item 2 of gBgRect - 2*tMargin) - tPieSize)/2) into tShift add tShift to item 2 of gChartRect add tShift to item 4 of gChartRect break case "bar" if the cShowGrid of tGroup > 0 then -- adjust legend dimensions if necessary for unit spec put tab & "1 division = " & the cDivSize of tGroup after line 1 of field "Legend" of tGroup end if put tBgHeight - tLegendHeight into tChartHeight put item 1 of gBgRect + tMargin, item 2 of gBgRect + tMargin, item 3 of gBgRect - tMargin, \ item 4 of gBgRect - tMargin - tLegendHeight into gChartRect put item 1 of gBgRect, item 4 of gBgRect - tLegendHeight, item 3 of gBgRect, item 4 of gBgRect into gLegendRect break end SWITCH end if -- breakpoint end setChartRects on okGridData put the long id of me into tGroup if the cGridColor of tGroup is not a color then set the cGridColor of tGroup to "Lightblue" end if if the cDivSize of tGroup is not a number or the cDivSize of tGroup <= 0 then set the cDivSize of tGroup to 5 end if if the cStressUnit of tGroup is not a number or the cStressUnit of tGroup < 0 then set the cStressUnit of tGroup to 0 end if end okGridData function okChartData put the long id of me into tGroup if the cChartType of tGroup is not "pie" and the cChartType of tGroup is not "bar" then set the cChartType of tGroup to "pie" if the cLegendFontSize of tGroup is not a number then set the cLegendFontSize of tGroup to 9 if the cPartOutlineSize of tGroup is not a number then set the cPartOutlineSize of tGroup to 0 if the cShowLegend of tGroup is not 0 and the cShowLegend of tGroup is not 1 then set the cShowLegend of tGroup to 1 set the textsize of field "Legend" of tGroup to the cLegendFontSize of tGroup put the cPartNames of tGroup into tNames put the cPartValues of tGroup into tValues put the cPartColors of tGroup into tColors if tNames is empty then answer "You must set the cPartNames property to a list of the data entry names." return false end if if tValues is empty then answer "You must set the cPartValues property to a list of the data entry values." return false end if if the number of items in tNames > the cMaxParts of me then answer "The number of data entries must be " & the cMaxParts of me & " or less." & cr & \ "The chart would be too cluttered to be useful." return false end if if (the number of items in tNames) <> (the number of items in tValues) then answer "The number of data names and data values is not equal." & cr & \ "Part Names = " & tNames & cr & "Part Values = " & tValues return false end if if (the number of items in tNames) > (the number of items in tColors) then answer "For your data, the colorNames property needs at least " & the number of items in tNames & " items." return false end if return true end okChartData setprop cChartRect pRect if item 3 of pRect - item 1 of pRect < 100 then put item 1 of pRect + 100 into item 3 of pRect if item 4 of pRect - item 2 of pRect < 100 then put item 2 of pRect + 100 into item 4 of pRect set the cChartRect of me to pRect end cChartRect function insetRect pRect, pOffset put pRect into tRect add pOffset to item 1 of tRect add pOffset to item 2 of tRect subtract pOffset from item 3 of tRect subtract pOffset from item 4 of tRect return tRect end insetRect on resizeControl _resizeControl end resizeControl on revCacheGeometry _resizeControl end revCacheGeometry private command _resizeControl constant kControlHeight = 0 -- set to 0 [zero] if no constraining is required local tLockLoc lock screen if (the environment = "development") then put the locklocation of me into tLockLoc set the locklocation of me to TRUE --- ensure that the control is contrained in height; set to 0 [zero] if no contraining is required if (kControlHeight > 0) and (the height of me <> kControlHeight) then set the height of me to kControlHeight end if --- move and resize the control's components set the cResizing of me to true put the long id of me into tGroup set the cChartRect of tGroup to the rect of tGroup makeChart set the cResizing of me to false if the mouse is "up" and the cShowGrid of me > 0 then makeChart -- draw with grid when finished resizing set the locklocation of me to tLockLoc -- restore the control's original locklocation setting end if unlock screen end _resizeControl $ :V cGridColor whitecPartColors _#495EDB,#7C49DB,#C549DB,#DB497C,#E8683B,#E8933B,#E8B63B,#E8D83B,#D5E838,#A0D62A,#2AD6C3,#2A8BD6 cShowPercent falsecPartOutlineSize 1cChartBgColor transparentcStressUnit 0cDivStress 0 cChartMargin 2 cHaveResized falsecPartNames ?peach,apple,pumpkin,cherry,blueberry,rhubarb,mince,banana creamcPartOutlineColor blackcBgRect 42,36,316,366cPartValues 4,30,19,12,3,15,23,17 cMaxParts 20cChartRect 36,30,350,374cLegendFontSize 10 cResizing false cOrientation verticalcBarGap 5 cDivSize 5 cShowGrid 1cLegendBgColor transparentcShowLegend 1cChartType bar cGlx2General cScriptChecksum cExplicitVariables cHscrollScript 0cLocals cHscrollHandlers 0cHtmlScript k6 |vw\%iH`;LʢJIȯėd946-r83TONZdKUD}tKٖf id/kxZ&;FNg0^j+=0<`N&%o~K:!PI]xrħVҫʧӢMUa yLiخ*h_βku^Lča]2g~߲!C諶ot##Vʌ\3;?\u\XXMI4ހ:P}kZ(`3Ĉ