public static void writeDataValue ( Writer fsw , String optionName , Object value , boolean hasComma ) throws IOException { if ( value == null ) { return ; } boolean isList = value instanceof List ; if ( hasComma ) { fsw . write ( "," ) ; } fsw . write ( "\"" + optionName + "\":" ) ; if ( isList ) { fsw . write ( "[" ) ; for ( int i = 0 ; i < ( ( List < ? > ) value ) . size ( ) ; i ++ ) { Object item = ( ( List < ? > ) value ) . get ( i ) ; Object writeText ; if ( item instanceof BubblePoint ) { BubblePoint point = ( BubblePoint ) item ; writeText = ( i == 0 ) ? "" : "," ; writeText += "{\"x\":" + point . getX ( ) + ",\"y\":" + point . getY ( ) + ",\"r\":" + point . getR ( ) + "}" ; } else if ( item instanceof String ) { String escapedText = EscapeUtils . forJavaScript ( ( String ) item ) ; writeText = ( i == 0 ) ? "\"" + escapedText + "\"" : ",\"" + escapedText + "\"" ; } else { writeText = ( i == 0 ) ? item : "," + item ; } fsw . write ( "" + writeText ) ; } fsw . write ( "]" ) ; } else { if ( value instanceof String ) { fsw . write ( "\"" + EscapeUtils . forJavaScript ( ( String ) value ) + "\"" ) ; } else { fsw . write ( "" + value ) ; } } }
Write the value of chartJs options