Revision: 4538
Author: seba.wagner
Date: Sat Nov 12 03:24:04 2011
Log: Fixing chart for poll results
http://code.google.com/p/openmeetings/source/detail?r=4538
Added:
/trunk/singlewebapp/WebContent/openmeetings/base/components/omcharts
/trunk/singlewebapp/WebContent/openmeetings/base/components/omcharts/library.lzx
/trunk/singlewebapp/WebContent/openmeetings/base/components/omcharts/omchartstyle.lzx
/trunk/singlewebapp/WebContent/openmeetings/base/components/omcharts/omlegend.lzx
/trunk/singlewebapp/WebContent/openmeetings/base/components/omcharts/ompiechart.lzx
Modified:
/trunk/singlewebapp/WebContent/openmeetings/base/components/library.lzx
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/conference/conferenceMenubar.lzx
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/polls/resultPollWin.lzx
=======================================
--- /dev/null
+++
/trunk/singlewebapp/WebContent/openmeetings/base/components/omcharts/library.lzx
Sat Nov 12 03:24:04 2011
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<library>
+
+ <include href="charts/styles/chartstyle.lzx"/>
+ <include href="charts/common/dataseries.lzx"/>
+ <include href="charts/common/viewspoolmanager.lzx"/>
+ <include href="charts/common/virtualdrawview.lzx"/>
+ <include href="charts/common/datalabel.lzx"/>
+ <include href="charts/common/chart.lzx"/>
+ <include href="charts/common/legend.lzx"/>
+ <include href="charts/piechart/piepiece.lzx"/>
+ <include href="charts/piechart/piechartplotarea.lzx"/>
+
+ <include href="charts/styles/strokestyle.lzx"/>
+ <include href="charts/piechart/piepiece.lzx"/>
+ <include href="utils/layouts/simplelayout.lzx"/>
+ <include href="extensions/drawview.lzx"/>
+
+ <include href="omchartstyle.lzx" />
+ <include href="omlegend.lzx" />
+ <include href="ompiechart.lzx" />
+
+
+</library>
=======================================
--- /dev/null
+++
/trunk/singlewebapp/WebContent/openmeetings/base/components/omcharts/omchartstyle.lzx
Sat Nov 12 03:24:04 2011
@@ -0,0 +1,138 @@
+<!---
+ @access public
+ @topic Components
+ @subtopic Charts
+ -->
+<library>
+
+<chartstyle name="omchartstyle">
+ <plotstyle name="plot" linesize="1" linecolor="0xCCCCCC"
fillcolor="0xffffff" opacity="0.5"/>
+ <chartbgstyle name="chartbgstyle">
+ <linestyle name="line" size="0"/>
+ <regionstyle name="region" color="0xFFFFFF" opacity="0.5"/>
+ </chartbgstyle>
+ <valueregionstyle name="valueregionstyle">
+ <linestyle name="line" color="0x000000" size="1" opacity="1"/>
+ <regionstyle name="region" color="0xB71CB3" opacity="0.8"
gradient="linear"/>
+ <labelstyle name="label" font="serif" fontsize="12"
fontcolor="0x000000"/>
+ <labelstyle name="tip" font="serif" fontsize="12"
fontcolor="0x000000"/>
+ </valueregionstyle>
+ <axisstyle name="haxisstyle">
+ <labelstyle name="label" font="Helmet" fontsize="16"
fontcolor="0x000000" fontangle="0"/>
+ <tickstyle name="tickmajor" color="0x000000" position="outside"
length="3" size="1">
+ <labelstyle name="label" font="serif" fontstyle="bold"
fontsize="12" fontcolor="0x606060"/>
+ </tickstyle>
+ <tickstyle name="tickminor" color="0xD3D3D3" position="outside"
length="3" size="1"/>
+ <linestyle name="axisline" color="0x000000" size="1"/>
+ <linestyle name="gridline" color="0xD3D3D3" size="1"/>
+ </axisstyle>
+ <axisstyle name="vaxisstyle">
+ <labelstyle name="label" font="Helmet" fontsize="16"
fontcolor="0x000000" fontangle="-90"/>
+ <tickstyle name="tickmajor" color="0x000000" position="outside"
length="3" size="1">
+ <labelstyle name="label" font="serif" fontsize="12"
fontcolor="0x606060"/>
+ </tickstyle>
+ <tickstyle name="tickminor" color="0x000000" position="outside"
length="3" size="1"/>
+ <linestyle name="axisline" color="0x000000" size="1"/>
+ <linestyle name="gridline" color="0xD3D3D3" size="1"/>
+ <regionstyle name="band1" color="0xE8EBEE" opacity="1"
gradient="linear"/>
+ <regionstyle name="band2" color="0xE3E5E7" opacity="1"
gradient="linear"/>
+ </axisstyle>
+ <valuelinestyle name="valuelinestyle">
+ <linestyle name="line" color="0xFF9999" size="2" opacity="1"/>
+ <labelstyle name="label" font="serif" fontsize="10"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ <labelstyle name="tip" font="serif" fontsize="10"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ </valuelinestyle>
+ <valuepointstyle name="valuepointstyle">
+ <pointstyle name="point" width="15" height="15" color="0x00ff00"
opacity=".5" shape="triangle" image="../../test/images/master.gif"/>
+ <labelstyle name="label" font="serif" fontsize="10"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ <labelstyle name="tip" font="serif" fontsize="10"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ </valuepointstyle>
+ <datastylelist name="datastyles">
+ <datastyle name="yline">
+ <pointstyle name="point" width="10" height="10"
color="0xF9F932" opacity="1" shape="diamond" strokeStyle="0xA3A304"
lineWidth="1"/>
+ <linestyle name="line" color="0xCCCCCC" size="1" opacity="1"
type="solid"/>
+ <regionstyle name="region" color="0xA6CEE3" opacity="1"
gradient="none"/>
+ <labelstyle name="label" font="serif" fontsize="9"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="12" fontangle="90"/>
+ <labelstyle name="tip" font="serif" fontsize="8"
fontcolor="0x000000"
+ linecolor="0xF9F932" fillcolor="0xFFFFC1" linesize="4"/>
+ </datastyle>
+ <datastyle name="bline">
+ <pointstyle name="point" width="10" height="10"
color="0x32ADFB" opacity="1" shape="fourpoint" strokeStyle="0x03609C"
lineWidth="1"/>
+ <linestyle name="line" color="0xCCCCCC" size="1" opacity="1"
type="solid"/>
+ <regionstyle name="region" color="0x1F78B4" opacity="1"
gradient="none"/>
+ <labelstyle name="label" font="serif" fontsize="9"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="12" fontangle="90"/>
+ <labelstyle name="tip" font="serif" fontsize="8"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ </datastyle>
+ <datastyle name="rline">
+ <pointstyle name="point" width="10" height="10"
color="0xFA8159" opacity="1" shape="circle" strokeStyle="0xB24C2C"
lineWidth="1"/>
+ <linestyle name="line" color="0xCCCCCC" size="1" opacity="1"
type="solid"/>
+ <regionstyle name="region" color="0xB2DF8A" opacity="1"
gradient="none"/>
+ <labelstyle name="label" font="serif" fontsize="9"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="12" fontangle="90"/>
+ <labelstyle name="tip" font="serif" fontsize="8"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ </datastyle>
+ <datastyle name="gline">
+ <pointstyle name="point" width="10" height="10"
color="0x58FB59" opacity="1" shape="square" strokeStyle="0x1D991D"
lineWidth="1"/>
+ <linestyle name="line" color="0xCCCCCC" size="1" opacity="1"
type="solid"/>
+ <regionstyle name="region" color="0x33A02C" opacity="1"
gradient="none"/>
+ <labelstyle name="label" font="serif" fontsize="9"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="12" fontangle="90"/>
+ <labelstyle name="tip" font="serif" fontsize="8"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ </datastyle>
+ <datastyle name="hline">
+ <pointstyle name="point" width="10" height="10"
color="0x58FB59" opacity="1" shape="square" strokeStyle="0x1D991D"
lineWidth="1"/>
+ <linestyle name="line" color="0xCCCCCC" size="1" opacity="1"
type="solid"/>
+ <regionstyle name="region" color="0xFB9A99" opacity="1"
gradient="none"/>
+ <labelstyle name="label" font="serif" fontsize="9"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="12" fontangle="90"/>
+ <labelstyle name="tip" font="serif" fontsize="8"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ </datastyle>
+ <datastyle name="iline">
+ <pointstyle name="point" width="10" height="10"
color="0x58FB59" opacity="1" shape="square" strokeStyle="0x1D991D"
lineWidth="1"/>
+ <linestyle name="line" color="0xCCCCCC" size="1" opacity="1"
type="solid"/>
+ <regionstyle name="region" color="0xE31A1C" opacity="1"
gradient="none"/>
+ <labelstyle name="label" font="serif" fontsize="9"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="12" fontangle="90"/>
+ <labelstyle name="tip" font="serif" fontsize="8"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ </datastyle>
+ <datastyle name="jline">
+ <pointstyle name="point" width="10" height="10"
color="0x58FB59" opacity="1" shape="square" strokeStyle="0x1D991D"
lineWidth="1"/>
+ <linestyle name="line" color="0xCCCCCC" size="1" opacity="1"
type="solid"/>
+ <regionstyle name="region" color="0xFDBF6F" opacity="1"
gradient="none"/>
+ <labelstyle name="label" font="serif" fontsize="9"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="12" fontangle="90"/>
+ <labelstyle name="tip" font="serif" fontsize="8"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ </datastyle>
+ <datastyle name="kline">
+ <pointstyle name="point" width="10" height="10"
color="0x58FB59" opacity="1" shape="square" strokeStyle="0x1D991D"
lineWidth="1"/>
+ <linestyle name="line" color="0xCCCCCC" size="1" opacity="1"
type="solid"/>
+ <regionstyle name="region" color="0xFF7F00" opacity="1"
gradient="none"/>
+ <labelstyle name="label" font="serif" fontsize="9"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="12" fontangle="90"/>
+ <labelstyle name="tip" font="serif" fontsize="8"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ </datastyle>
+ <datastyle name="lline">
+ <pointstyle name="point" width="10" height="10"
color="0x58FB59" opacity="1" shape="square" strokeStyle="0x1D991D"
lineWidth="1"/>
+ <linestyle name="line" color="0xCCCCCC" size="1" opacity="1"
type="solid"/>
+ <regionstyle name="region" color="0xCAB2D6" opacity="1"
gradient="none"/>
+ <labelstyle name="label" font="serif" fontsize="9"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="12" fontangle="90"/>
+ <labelstyle name="tip" font="serif" fontsize="8"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ </datastyle>
+ <datastyle name="mline">
+ <pointstyle name="point" width="10" height="10"
color="0x58FB59" opacity="1" shape="square" strokeStyle="0x1D991D"
lineWidth="1"/>
+ <linestyle name="line" color="0xCCCCCC" size="1" opacity="1"
type="solid"/>
+ <regionstyle name="region" color="0x6A3D9A" opacity="1"
gradient="none"/>
+ <labelstyle name="label" font="serif" fontsize="9"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="12" fontangle="90"/>
+ <labelstyle name="tip" font="serif" fontsize="8"
fontcolor="0x000000"
+ linecolor="0x000000" fillcolor="0xFFFFC1" linesize="2"/>
+ </datastyle>
+ </datastylelist>
+</chartstyle>
+
+</library>
=======================================
--- /dev/null
+++
/trunk/singlewebapp/WebContent/openmeetings/base/components/omcharts/omlegend.lzx
Sat Nov 12 03:24:04 2011
@@ -0,0 +1,262 @@
+<!---
+ @access public
+ @topic Components
+ @subtopic Charts
+ -->
+<library>
+
+ <!---
+ simple legend class
+ @access public
+ -->
+ <class name="omlegend" extends="drawview" >
+ <!--- @keyword private -->
+ <attribute name="topmargin" type="number" value="0"/>
+ <!--- @keyword private -->
+ <attribute name="bottommargin" type="number" value="0"/>
+ <!--- @keyword private -->
+ <attribute name="leftmargin" type="number" value="0"/>
+ <!--- @keyword private -->
+ <attribute name="rightmargin" type="number" value="0"/>
+ <!--- @keyword private -->
+ <attribute name="verticalgap" type="number" value="1"/>
+ <!--- Indicates if legend box will have a border, default: true -->
+ <attribute name="legendborder" type="boolean" value="true"/>
+ <!--- Allow to set the line width from the legend tag -->
+ <attribute name="borderWidth" type="number" value="1"/>
+ <!--- Allow to set the color line from the legend tag -->
+ <attribute name="borderColor" type="color" value="0x000000"/>
+ <!--- Allow to set the fill color from the legend tag -->
+ <attribute name="fillColor" type="color" value="0xFFFFFF"/>
+ <!--- Indicates how the legend items will be displayed, default:
vertical -->
+ <attribute name="direction" type="string" value="vertical"/>
+ <!--- Indicates the style will be applied tho the border legend
box -->
+ <attribute name="styleBorder" type="string" value="null"/>
+ <!--- Indicates the Font will be used in the legend item text -->
+ <attribute name="legendFont" type="string" value="serif"/>
+ <!--- Indicates the Font size wiil be used in the legend item
text, default: 10px -->
+ <attribute name="legendFontsize" type="size" value="6"/>
+ <!--- Indicates the Font color wiil be used in the legend item
text, default: black -->
+ <attribute name="legendFontcolor" type="color" value="0x000000"/>
+ <!--- Indicates where the legend box will be positioned, default:
right -->
+ <attribute name="position" type="string" value="right"/>
+
+ <!--- Takes the relationship with the chart -->
+ <attribute name="chart" type="expression" value="${null}"/>
+ <attribute name="chartClassName" type="string" value="${null}"/>
+
+ <simplelayout axis="y"/>
+
+
+ <!--- @keywords private
+ <handler name="oninitdone" reference="this.chart">
+ if(chart.initdone)
+ {
+ var lChart = this.getChartInstance();
+ if( lChart != null ) {
+ this.chartClassName = lChart.constructor.tagname;
+
this.datapath.setFromPointer(lChart.getDataSeries().getLegend());
+ }
+ }
+ </handler>
+ -->
+
+ <handler name="oninit">
+ <![CDATA[
+ var tObject = parent.getOMDataSeries();
+ this.chart = parent;
+
+ for (var i=0;i<tObject.tooltipseries.length;i++) {
+
+ new
lz.omlegenditem(this.viewlegendbox,{tBox:tObject.tooltipseries[i]});
+
+ }
+
+ //this.bringToFront();
+ this.border();
+ ]]>
+ </handler>
+
+ <!-- Top Margin -->
+ <view height="${parent.topmargin}" />
+ <!-- Legend box -->
+ <view name="viewlegendbox">
+ <simplelayout spacing="${parent.parent.verticalgap}"/>
+ <method name="init">
+ <![CDATA[
+
+ super.init();
+ if ( parent.direction == 'horizontal'){
+ this.layouts[0].setAttribute('axis', 'x');
+ } else {
+ this.layouts[0].setAttribute('axis', 'y');
+ }
+
+ ]]>
+ </method>
+
+ </view>
+ <!-- Bottom Margin -->
+ <view height="${parent.bottommargin}"/>
+
+
+ <!--- @keywords private -->
+ <method name="border">
+ var lStartX = Math.ceil(this.lineWidth/2);
+ var lStartY = Math.ceil(this.lineWidth/2);
+ var lOrgWidth = this.width;
+ var lOrgHeight = this.height;
+
+ this.lineWidth = this.borderWidth;
+ this.strokeStyle = this.borderColor;
+ this.fillStyle = this.fillColor;
+
+ this.beginPath();
+ this.moveTo(lStartX, lStartY);
+ this.lineTo(this.width, lStartY);
+ this.lineTo(this.width, this.height);
+ this.lineTo(lStartY, this.height);
+ this.lineTo(lStartX, lStartY);
+ this.closePath();
+ this.stroke();
+ this.fill();
+
+ // Restores the original dimensions of the legend, due to the
changes
+ // that the lineTo()'s calls perform over the legendbox
dimensions.
+ this.setAttribute( "width", lOrgWidth );
+ this.setAttribute( "height", lOrgHeight );
+ </method>
+
+ <!--- @keywords private -->
+ <method name="getChartInstance">
+ <![CDATA[
+ return this.chart;
+ ]]>
+ </method>
+
+ <!--- event that allows custom action for mouse over event
+ @param Number item: The identifier legend item
+ -->
+ <event name="onitemmouseover" />
+ <!--- event that allows custom action for mouse out event
+ @param Number item: The identifier legend item
+ -->
+ <event name="onitemmouseout" />
+ <!--- event that allows custom action for mouse down event
+ @param Number item: The identifier legend item
+ -->
+ <event name="onitemmousedown" />
+ <!--- event that allows custom action for mouse up event
+ @param Number item: The identifier legend item
+ -->
+ <event name="onitemmouseup" />
+ <!--- event that allows custom action for mouse click event
+ @param Number item: The identifier legend item
+ -->
+ <event name="onitemmouseclick" />
+
+ </class>
+
+ <!--- @keyword private
+ individual legend item -->
+ <class name="omlegenditem" >
+ <attribute name="identifier" type="number" value="0"/>
+ <attribute name="tBox" type="string" value=""/>
+ <attribute name="linevisible" type="boolean" value="false"/>
+ <simplelayout axis="x"
spacing="$once{parent.parent.parent.verticalgap}"/>
+ <view name="leftmarginview"
width="$once{parent.parent.parent.leftmargin}" />
+ <marker name="legendmarker"></marker>
+ <text name="legendtext" resize="true" text="$once{ parent.tBox }"
+ fontsize="$once{parent.parent.parent.legendFontsize}"
+ fgcolor="$once{parent.parent.parent.legendFontcolor}"
+ height="$once{parent.parent.parent.legendFontsize+6}">
+ </text>
+ <view name="rightmarginview"
width="${parent.parent.parent.rightmargin}"/>
+ <method name="init">
+ <![CDATA[
+ super.init();
+
+ var colors = new Array(0);
+ var imagesPath = new Array(0);
+ var legenditems = parent.subviews;
+ var legendmarkeritem;
+
+ if( parent.parent.chartClassName == "piechart" ) {
+ var arrPieces =
parent.parent.getChartInstance().plotarea.arrPiePieces;
+ var piePiece;
+
+ for(var i = 0; i < arrPieces.length; i++){
+ piePiece = arrPieces[i];
+ colors[i] = piePiece.style.region.color;
+
+ if ( legenditems[i] != null ){
+ legendmarkeritem = legenditems[i].legendmarker;
+ legendmarkeritem.setAttribute('width',
piePiece.style.point.width);
+ legendmarkeritem.setAttribute('height',
piePiece.style.point.height);
+ }
+ }
+ } else {
+ var topseries =
parent.parent.getChartInstance().getDataSeries();
+ var numSeries = topseries.getNumDataSeries();
+ for(var i = 0; i < numSeries; i++){
+ var ldatastyle =
parent.parent.getChartInstance().style.getDataStyle(i);
+ if ( parent.parent.chartClassName == "linechart" )
+ colors[i] = ldatastyle.line.color;
+ else
+ if ( ldatastyle.region.image != null ){
+ imagesPath[i] = ldatastyle.region.image;
+ } else {
+ colors[i] = ldatastyle.region.color;
+ }
+ if ( legenditems[i] != null ){
+ legendmarkeritem = legenditems[i].legendmarker;
+ legendmarkeritem.setAttribute('width',
ldatastyle.point.width);
+ legendmarkeritem.setAttribute('height',
ldatastyle.point.height);
+ }
+ }
+ }
+
+ for(var i = 0; i < legenditems.length; i++){
+ var legenditem = legenditems[i];
+ legendmarkeritem = legenditem.legendmarker;
+ if ( imagesPath[i] != null ){
+ legendmarkeritem.setSource(imagesPath[i]);
+ legendmarkeritem.setAttribute('opacity',
ldatastyle.region.opacity);
+ legendmarkeritem.setAttribute( "visible", true );
+ }
+ else
+ legendmarkeritem.setAttribute('bgcolor',
colors[i]);
+ this.setAttribute('identifier', i);
+ }
+ ]]>
+ </method>
+ <!--- calls the method that implements the acton
+ @keyword private-->
+ <handler name="onmouseover">
+ this.legendtext.setAttribute("fontstyle","bold");
+ parent.classroot.onitemmouseover.sendEvent(this);
+ </handler>
+ <!--- calls the method that implements the acton
+ @keyword private-->
+ <handler name="onmouseout">
+ this.legendtext.setAttribute("fontstyle","plain");
+ parent.classroot.onitemmouseout.sendEvent(this);
+ </handler>
+ <!--- calls the method that implements the acton
+ @keyword private-->
+ <handler name="onmousedown">
+ parent.classroot.onitemmousedown.sendEvent(this);
+ </handler>
+ <!--- calls the method that implements the acton
+ @keyword private-->
+ <handler name="onmouseup">
+ parent.classroot.onitemmouseup.sendEvent(this);
+ </handler>
+ <!--- calls the method that implements the acton
+ @keyword private-->
+ <handler name="onclick">
+ parent.classroot.onitemmouseclick.sendEvent(this);
+ </handler>
+ </class>
+
+</library>
=======================================
--- /dev/null
+++
/trunk/singlewebapp/WebContent/openmeetings/base/components/omcharts/ompiechart.lzx
Sat Nov 12 03:24:04 2011
@@ -0,0 +1,87 @@
+<!---
+ @access public
+ @topic Components
+ @subtopic Charts
+ -->
+<library>
+
+ <!---
+ A pie chart represents a chart that is displayed in the 2D
+ polar plane. This class inherits immediately from chart class
+ and can be instantiated directly. (Warning: Of beta quality.)
+ @access public
+ -->
+ <class name="ompiechart" extends="chart">
+
+ <!--- @keywords private -->
+ <method name="init">
+ plotarea = this.getNodeOfClass("piechartplotarea");
+ _datalabelpool = this.createLabelViewspool();
+ super.init();
+ </method>
+
+ <!--- Renders the plot area which is an instance of the
piechartplotarea
+ class. The plot area requires to read a group of two data
series, one
+ for the groups that are represented by the pie slices and
the second
+ for their values. -->
+ <method name="renderPlotArea">
+ <![CDATA[
+ super.renderPlotArea();
+ plotarea.clear();
+
+ var topseries = this.getOMDataSeries();
+
+ //var numSeries = topseries.getNumDataSeries();
+ var numSeries = 1;
+
+ var xseries = topseries.xseries;
+ var yseries = topseries.yseries;
+ var tooltipseries = topseries.tooltipseries;
+
+ for(var i = 0; i < numSeries; i++)
+ {
+ plotarea.renderSeries(xseries, yseries, tooltipseries);
+ }
+ if ( this.datalabelEnabled ){
+ this.renderDataLabels();
+ }
+
+ ]]>
+ </method>
+
+ <!--- Renders the labels that display the values of the data
series. -->
+ <method name="renderDataLabels">
+
+ <![CDATA[
+ _datalabelpool.reclaimAll();
+
+ var arrPiePieces = this.plotarea.arrPiePieces;
+ var topseries = this.getOMDataSeries();
+
+ var xseries = topseries.xseries;
+ var yseries = topseries.yseries;
+ var tooltipseries = topseries.tooltipseries;
+
+ if ($debug)
Debug.write("arrPiePieces.length ",arrPiePieces.length);
+
+ for(var i = 0; i < arrPiePieces.length; i++){
+ piePiece = arrPiePieces[i];
+
+ var lbl = _datalabelpool.getView();
+ var ldatastyle = piePiece.style;
+ lbl.setAttribute('style', ldatastyle.label);
+ lbl.render(yseries[i]);
+ piePiece.renderLabel(lbl);
+ }
+ ]]>
+
+ </method>
+
+ <!--- The plot area where the pie slices are rendered -->
+ <piechartplotarea name="plotarea" x="50" y="20" width="500"
height="300">
+
+ </piechartplotarea>
+
+ </class>
+
+</library>
=======================================
--- /trunk/singlewebapp/WebContent/openmeetings/base/components/library.lzx
Sat Apr 10 04:43:25 2010
+++ /trunk/singlewebapp/WebContent/openmeetings/base/components/library.lzx
Sat Nov 12 03:24:04 2011
@@ -10,6 +10,7 @@
<include href="labeltabelement.lzx" />
<include href="text/" />
+ <include href="omcharts/" />
<include href="button/" />
<include href="clickbox/" />
<include href="explorer/" />
=======================================
---
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/conference/conferenceMenubar.lzx
Tue Nov 8 08:30:27 2011
+++
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/conference/conferenceMenubar.lzx
Sat Nov 12 03:24:04 2011
@@ -149,7 +149,7 @@
<_labelMenuItem width="250" id="lblPoll" labelid="24"
command="cmd_createPoll" enabled="${ canvas.ismoderator
}" />
<_labelMenuItem width="250" id="lblPollResult"
- labelid="37" command="cmd_pollResults" enabled="${ canvas.ismoderator
}" />
+ labelid="37" command="cmd_pollResults" /><!-- enabled="${
canvas.ismoderator }" -->
<_labelMenuItem width="250" id="lblPollVote"
labelid="42"
command="cmd_checkPollVoted" />
<menuseparator />
@@ -264,7 +264,7 @@
<_labelMenuItem width="250" labelid="24"
command="cmd_createPoll"
enabled="${ canvas.ismoderator }" />
<_labelMenuItem width="250" labelid="37"
command="cmd_pollResults"
- enabled="${ canvas.ismoderator }" />
+ /> <!-- enabled="${ canvas.ismoderator }"
-->
<_labelMenuItem width="250" labelid="42"
command="cmd_checkPollVoted" />
<menuseparator />
@@ -333,7 +333,7 @@
<_labelMenuItem width="250" labelid="24"
command="cmd_createPoll"
enabled="${ canvas.ismoderator }" />
<_labelMenuItem width="250" labelid="37"
command="cmd_pollResults"
- enabled="${ canvas.ismoderator }" />
+ /><!-- enabled="${ canvas.ismoderator }"
-->
<_labelMenuItem width="250" labelid="42"
command="cmd_checkPollVoted" />
</_labelMenu>
=======================================
---
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/polls/resultPollWin.lzx
Sun Nov 6 06:18:21 2011
+++
/trunk/singlewebapp/WebContent/openmeetings/modules/conference/polls/resultPollWin.lzx
Sat Nov 12 03:24:04 2011
@@ -2,8 +2,8 @@
<library>
<class name="resultPollWin" extends="labelExplorerBox" labelid="37"
- docking="true" resizeable="false" closable="true" width="500"
x="100"
- height="410">
+ docking="true" resizeable="false" closable="true" width="454"
x="100"
+ height="454">
<attribute name="roomPoll" value="null" />
<attribute name="archPolls" value="null" />
@@ -20,69 +20,114 @@
this.head.setAttribute('text',
canvas.getLabelName(41));
return;
}
- this.head.setAttribute('text'
- , (canvas.user_id == poll.createdBy.user_id ?
canvas.getLabelName(1411) : poll.createdBy.login)
- + " " + canvas.getLabelName(36));
-
+ this.head.setAttribute('text',
+ (canvas.user_id ==
poll.createdBy.user_id ? canvas
+ .getLabelName(1411) :
poll.createdBy.login)
+ + " " +
canvas.getLabelName(36));
+
var totalVotes = poll.roomPollAnswerList.length;
- this.content.question.setAttribute('text',
poll.pollQuestion);
+ this.content.question.text.setAttribute('text',
poll.pollQuestion);
this.content.voteResultNum.setAttribute('text',
totalVotes);
if (this.resultpollvotes != null) {
this.resultpollvotes.destroy();
}
- this.resultpollvotes = new lz.view(this.content, {y:
142, x: 100});
-
+ this.resultpollvotes = new lz.view(this.content, {
+ y : 146,
+ x : 100
+ });
+
var isNumeric = poll.pollType.isNumericAnswer;
var resArray = new Array(isNumeric ? 10 : 2);
for (var i = 0; i < resArray.length; ++i) {
resArray[i] = 0;
}
for (var i = 0; i < totalVotes; ++i) {
- var idx = isNumeric ? poll.roomPollAnswerList[i].pointList - 1 :
(poll.roomPollAnswerList[i].answer ? 0 : 1);
+ var idx = isNumeric
+ ?
poll.roomPollAnswerList[i].pointList - 1
+ :
(poll.roomPollAnswerList[i].answer ? 0 : 1);
resArray[idx]++;
}
if (content._chartType.getValue() == 0) {
- new lz.simplelayout(this.resultpollvotes,
{axis: 'y', spacing: 2});
+ new lz.simplelayout(this.resultpollvotes, {
+ axis : 'y',
+ spacing : 2
+ });
for (var i = 0; i < resArray.length; ++i) {
- var pos = (totalVotes == 0) ? 0 : Math.round( 100 * resArray[i] /
totalVotes);
- new lz.parentResultPollBalk(
- this.resultpollvotes
- ,{newX: pos * 2
- , newPercent: pos + '%'
- , textA: isNumeric ? i
+ 1 : canvas.getLabelName(i == 0 ? 34 : 35)
- }
- );
+ var pos = (totalVotes == 0) ? 0 :
Math.round(100
+ * resArray[i] /
totalVotes);
+ new
lz.parentResultPollBalk(this.resultpollvotes, {
+ newX : pos * 2,
+ newPercent :
pos + '%',
+ textA :
isNumeric ? i + 1 : canvas
+
.getLabelName(i == 0 ? 34 : 35)
+ });
}
} else {
- var block = new lz.chartBlock(resultpollvotes, {poll: poll, resArray:
resArray});
- block._chart.completeInstantiation();
+
+ if (!isNumeric) {
+ //yes/no
+ new
lz.resultPieCharPoll(this.resultpollvotes, {
+ xseries : ["yes",
"no"],
+ yseries :
resArray,
+ tooltipseries : ["yes
("+resArray[0]+")", "no ("+resArray[1]+")"]
+ });
+ } else {
+
+ if ($debug)
+ Debug.write("tObject 1 ", ["1", "2", "3",
"4", "5",
+ "6", "7", "8",
"9", "10"]);
+ if ($debug)
+ Debug.write("tObject 2 ",
resArray);
+
+ var tooltipseries = new
Array(resArray.length);
+ for (var i=0;i<resArray.length;i++) {
+ tooltipseries[i] = "N° "+i+" ("+
resArray[i] +")";
+ }
+
+ //numeric [1,2,3,4,5,6,7,8,9,10]
+ new
lz.resultPieCharPoll(this.resultpollvotes, {
+ xseries : ["1", "2", "3", "4", "5", "6", "7",
"8", "9",
+ "10"],
+ yseries : resArray,
+ tooltipseries : tooltipseries
+ });
+ }
+
}
]]>
</method>
- <labelText y="22" name="head" />
-
- <labelText y="42" name="archPollLbl" labelid="1412" />
- <resetCombobox name="_archPolls" width="380" x="100" y="42"
+ <labelText y="22" name="archPollLbl" labelid="1412" />
+ <resetCombobox name="_archPolls" width="342" x="100" y="22"
editable="false" itemclassname="bigTextListItem">
<netRemoteCallHib name="getArchivedPollList"
funcname="pollservice.getArchivedPollList" remotecontext="$once{
canvas.thishib }">
<handler name="ondata" args="value">
<![CDATA[
+
+
+ if ($debug)
+ Debug.write("getArchivedPollList
", value);
+
if (value == null) {
this.parent.setAttribute("visible", false);
-
this.parent.parent.archPollLbl.setAttribute("visible", false);
+
this.parent.parent.archPollLbl.setAttribute("visible",
+ false);
return;
}
this.parent.parent.archPolls = value;
if (this.parent.parent.roomPoll !=
null) {
- this.parent.addItem(this.parent.parent.roomPoll.pollName + "(" +
canvas.getLabelName(1413) + ")", -1);
+ this.parent.addItem(
+
this.parent.parent.roomPoll.pollName + "("
+ +
canvas.getLabelName(1413) + ")", -1);
}
for (var i = 0; i < value.length; ++i) {
this.parent.addItem(value[i].pollName, i);
}
-
this.parent.selectItem(this.parent.parent.roomPoll == null ? 0 : -1);
+
this.parent.selectItem(this.parent.parent.roomPoll == null
+ ? 0
+ : -1);
]]>
</handler>
</netRemoteCallHib>
@@ -90,34 +135,47 @@
this.getArchivedPollList.doCall();
</handler>
<handler name="onselect" args="sel">
- if ($debug) Debug.write("onselect ", sel);
- this.parent.displayResults(sel.value > -1 ?
- this.parent.archPolls[sel.value] :
this.parent.roomPoll);
+ if ($debug)
+ Debug.write("onselect ", sel);
+ this.parent.displayResults(sel.value > -1
+ ?
this.parent.archPolls[sel.value]
+ : this.parent.roomPoll);
</handler>
</resetCombobox>
+
+ <labelText x="2" y="42" name="head" fontstyle="bold" />
<view name="content">
- <labelText name="question" y="62" x="0" height="60"
width="380"
- multiline="true" resize="false" />
-
+
+ <view name="question" x="2" y="62" width="440" height="60" text=""
bgcolor="0xFFFFFF">
+ <labelText x="0" y="0" name="text"
multiline="true"
+ resize="false"
width="$once{parent.width-14}" />
+ <vscrollbar/>
+ </view>
+
<labelText y="122" labelid="39" />
<labelText y="122" x="100" name="voteResultNum" />
- <resetCombobox name="_chartType" width="100" x="130" y="122"
editable="false" >
+ <resetCombobox name="_chartType" width="302" x="140" y="122"
editable="false" >
<labeldTextListItem labelid="1414" value="0"/>
<labeldTextListItem labelid="1415" value="1"
selected="true" />
<handler name="onselect" args="sel">
- if ($debug) Debug.write("onselect ",
sel);
+ if ($debug)
+ Debug.write("onselect ", sel);
var val =
parent.parent._archPolls.getValue();
- if ($debug) Debug.write("AAAAA ", val);
- parent.parent.displayResults(val > -1 ?
parent.parent.archPolls[val] : parent.parent.roomPoll);
+ if ($debug)
+ Debug.write("AAAAA ", val);
+ parent.parent.displayResults(val > -1
+ ?
parent.parent.archPolls[val]
+ :
parent.parent.roomPoll);
</handler>
</resetCombobox>
- <labelText y="142" labelid="40" />
+ <labelText y="146" labelid="40" x="2" />
</view>
- <simpleLabelButton labelid="25" width="100" x="390"
- y="$once{ parent.height-22 }"
onclick="this.parent.close();" />
-
+
+ <simpleLabelButton labelid="25" width="100" x="$once{
parent.width-102 }"
+ y="$once{ parent.height-22 }" onclick="this.parent.close();" />
+
</class>
<class name="parentResultPollBalk" extends="view">
@@ -138,57 +196,47 @@
duration="1000" />
</class>
- <class name="chartBlock" extends="view">
- <attribute name="poll" value="null" />
- <attribute name="resArray" value="null" />
-
- <dataset />
-
+ <class name="resultPieCharPoll" extends="ompiechart" x="40" width="300"
+ height="280" style="omchartstyle">
+
+ <attribute name="xseries" value="null"/>
+ <attribute name="yseries" value="null"/>
+ <attribute name="tooltipseries" value="null"/>
+
<handler name="oninit">
+ this.legendbox.bringToFront();
+ </handler>
+
+ <!--- get the dataseries -->
+ <method name="getOMDataSeries">
<![CDATA[
- if ($debug) Debug.write("selectedPollSet::init ->
poll", poll);
- if ($debug) Debug.write("selectedPollSet::init ->
resArray", resArray);
- var answers = new lz.DataElement("answers");
- for (var i = 0; i < resArray.length; ++i) {
- answers.appendChild(new lz.DataElement("answer", {label: "" + (i + 1),
data: "" + resArray[i]}));
- }
- this.localdata.appendChild(answers);
- if ($debug) Debug.write("selectedPollSet::init -> this.localdata",
this.localdata);
+ var tObject = new Object();
+
+ tObject.xseries = this.xseries;
+ tObject.yseries = this.yseries;
+ tObject.tooltipseries = this.tooltipseries;
+
+ return tObject;
]]>
- </handler>
-
- <piechart width="380" height="240" name="_chart"
initstage="defer"
- dataPointsEnabled="false" datalabelEnabled="true" datalabelColumn="y"
style="defaultchartstyle">
- <dataseries
datapath="local:parent.parent.localdata:/answers">
- <datacolumn name="x" columndatapath="answer/@label" datatype="number"
/>
- <dataseries label="votes">
- <datacolumn name="y" columndatapath="answer/@data" datatype="number"
/>
- </dataseries>
- <datacolumn name="tooltip"
columndatapath="answer">
- <method name="processData" args="v">
- var lbl =
parent.parent.parent.poll.pollType.isNumericAnswer
- ? v.attributes.label
- :
canvas.getLabelName(v.attributes.label == "1" ? 34 : 35);
-
- return "vote: " + lbl + " count:
" + v.attributes.data;
- </method>
- </datacolumn>
- </dataseries>
-
- <strokestyle name="pieslicestyle" strokeColor="0x000000"
- strokeWidth="2" strokeType="dotted" />
- <legend name="legendbox" legendFontsize="14"
initstage="late"
- legendborder="false">
- <handler name="onitemmouseover" args="item">
- var piepiece =
parent.plotarea.arrPiePieces[item.identifier];
- piepiece.renderInnerWedge();
- </handler>
-
- <handler name="onitemmouseout" args="item">
- var piepiece =
parent.plotarea.arrPiePieces[item.identifier];
- piepiece.renderWedge();
- </handler>
- </legend>
- </piechart>
- </class>
+ </method>
+
+ <strokestyle name="pieslicestyle" strokeColor="0x000000"
strokeWidth="1"
+ strokeType="solid" />
+
+ <omlegend name="legendbox" legendFontsize="14" initstage="late"
+ legendborder="true" >
+
+ <handler name="onitemmouseover" args="item">
+ var piepiece =
parent.plotarea.arrPiePieces[item.identifier];
+ piepiece.renderInnerWedge();
+ </handler>
+
+ <handler name="onitemmouseout" args="item">
+ var piepiece =
parent.plotarea.arrPiePieces[item.identifier];
+ piepiece.renderWedge();
+ </handler>
+ </omlegend>
+
+ </class>
+
</library>
--
You received this message because you are subscribed to the Google Groups
"OpenMeetings developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/openmeetings-dev?hl=en.