valuepoints.lzx
<library>
<include href="label.lzx"/>
<include href="datamarker.lzx"/>
<class name="valuepoints">
<attribute name="datax" type="expression"/>
<attribute name="datay" type="expression"/>
<attribute name="label" type="string" value="
"/>
<attribute name="tip" type="string" value="
"/>
<datamarker name="marker"/>
<label name="txt" y="0" x="${parent.parent.style.valuepointstyle.point.width}"/>
<method name="processData" args="pLabel">
return pLabel;
</method>
<handler name="onmouseover">
var ldata;
if ( this.tip == '' ){
ldata = (this.label!=''?this.label+' : ':'') + this.datax + ','+this.datay ;
} else{
ldata = this.tip;
}
parent.datatooltip.style = parent.style.valuepointstyle.tip;
parent.datatooltip.show(ldata);
</handler>
<handler name="onmouseout">
parent.datatooltip.hide();
</handler>
<method name="render">
this.renderValuePoint();
</method>
<method name="renderValuePoint">
//Calculate points on the graphic
var lDistanceX = parent.haxis.getPixelDistance(this.datax);
var lDIstanceY = parent.vaxis.getPixelDistance(this.datay);
var lExtraTextDistance = 0;
//if label enabled, set styles and calcualte length
if (this.label!=null && this.label.length>0) {
this.txt.style = parent.style.valuepointstyle.label;
this.txt.render(this.processData(this.label));
lExtraTextDistance = this.txt.getTextWidth();
} else {
this.txt.setAttribute('visible',false);
}
//resize this view
this.setAttribute('width', parent.style.valuepointstyle.point.width+lExtraTextDistance);
this.setAttribute('height', parent.style.valuepointstyle.point.height);
//move to the point and center
this.setAttribute('x', parent.plotarea.x + lDistanceX - (parent.style.valuepointstyle.point.width/2));
this.setAttribute('y', parent.plotarea.y + (parent.plotarea.height - lDIstanceY) - (parent.style.valuepointstyle.point.height/2));
this.marker.clear();
this.marker.style = parent.style.valuepointstyle;
this.marker.renderValuePoint();
</method>
<doc>
<tag name="shortdesc"><text>
a group of values in a chart
</text></tag>
<text>
<warning>This component is of Beta quality and is subject to change.</warning>
</text>
</doc>
</class>
</library>
Cross References
Includes
Classes