@ -121,43 +121,43 @@ exports.getDOMElement = function (elementType, JSONcontainer, DOMContainer, inse
/ * *
/ * *
* d raw a point object . this is a sepe rate function because it can also be called by the legend .
* D raw a point object . This is a sepa rate function because it can also be called by the legend .
* The reason the JSONcontainer and the target SVG svgContainer have to be supplied is so the legend can use these functions
* The reason the JSONcontainer and the target SVG svgContainer have to be supplied is so the legend can use these functions
* as well .
* as well .
*
*
* @ param x
* @ param x
* @ param y
* @ param y
* @ param group
* @ param groupTemplate : A template containing the necessary information to draw the datapoint e . g . , { style : 'circle' , size : 5 , className : 'className' }
* @ param JSONcontainer
* @ param JSONcontainer
* @ param svgContainer
* @ param svgContainer
* @ param labelObj
* @ param labelObj
* @ returns { * }
* @ returns { * }
* /
* /
exports . drawPoint = function ( x , y , group , JSONcontainer , svgContainer , labelObj ) {
exports . drawPoint = function ( x , y , groupTemplate , JSONcontainer , svgContainer , labelObj ) {
var point ;
var point ;
if ( group . options . drawPoints . style == 'circle' ) {
point = exports . getSVGElement ( 'circle' , JSONcontainer , svgContainer ) ;
if ( groupTemplate . style == 'circle' ) {
point = exports . getSVGElement ( 'circle' , JSONcontainer , svgContainer ) ;
point . setAttributeNS ( null , "cx" , x ) ;
point . setAttributeNS ( null , "cx" , x ) ;
point . setAttributeNS ( null , "cy" , y ) ;
point . setAttributeNS ( null , "cy" , y ) ;
point . setAttributeNS ( null , "r" , 0.5 * group . options . drawPoints . size ) ;
point . setAttributeNS ( null , "r" , 0.5 * groupTemplate . size ) ;
}
}
else {
else {
point = exports . getSVGElement ( 'rect' , JSONcontainer , svgContainer ) ;
point . setAttributeNS ( null , "x" , x - 0.5 * group . options . drawPoints . size ) ;
point . setAttributeNS ( null , "y" , y - 0.5 * group . options . drawPoints . size ) ;
point . setAttributeNS ( null , "width" , group . options . drawPoints . size ) ;
point . setAttributeNS ( null , "height" , group . options . drawPoints . size ) ;
point = exports . getSVGElement ( 'rect' , JSONcontainer , svgContainer ) ;
point . setAttributeNS ( null , "x" , x - 0.5 * groupTemplate . size ) ;
point . setAttributeNS ( null , "y" , y - 0.5 * groupTemplate . size ) ;
point . setAttributeNS ( null , "width" , groupTemplate . size ) ;
point . setAttributeNS ( null , "height" , groupTemplate . size ) ;
}
}
if ( group . options . drawPoints . styles !== undefined ) {
point . setAttributeNS ( null , "style" , group . group . options . drawPoints . styles ) ;
if ( groupTemplate . style !== undefined ) {
point . setAttributeNS ( null , "style" , groupTemplate . style ) ;
}
}
point . setAttributeNS ( null , "class" , group . className + " vis-point" ) ;
point . setAttributeNS ( null , "class" , groupTemplate . className + " vis-point" ) ;
//handle label
//handle label
if ( labelObj ) {
if ( labelObj ) {
var label = exports . getSVGElement ( 'text' , JSONcontainer , svgContainer ) ;
var label = exports . getSVGElement ( 'text' , JSONcontainer , svgContainer ) ;
if ( labelObj . xOffset ) {
if ( labelObj . xOffset ) {
x = x + labelObj . xOffset ;
x = x + labelObj . xOffset ;
}
}