private CategoryLabelPositions categoryLabelPosition(String position) { if (position == null) { return CategoryLabelPositions.STANDARD; } else if (position.equals("UP_45")) { return CategoryLabelPositions.UP_45; } else if (position.equals("UP_90")) { return CategoryLabelPositions.UP_90; } else if (position.equals("DOWN_45")) { return CategoryLabelPositions.DOWN_45; } else if (position.equals("DOWN_90")) { return CategoryLabelPositions.DOWN_90; } double angle = Double.parseDouble(position); if (angle>0) { return CategoryLabelPositions.createUpRotationLabelPositions(angle); } else { return CategoryLabelPositions.createDownRotationLabelPositions(-angle); } }
public void setCategoryLabelRotation( final Node rotationDirection, final Node rotationAngle ) { // down is the default String direction = "down"; //$NON-NLS-1$ if ( rotationDirection != null ) { direction = rotationDirection.getText(); } if ( rotationAngle != null ) { if ( "up".equalsIgnoreCase( direction ) ) { //$NON-NLS-1$ setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions( Double .parseDouble( rotationAngle.getText() ) ) ); } else { setCategoryLabelPositions( CategoryLabelPositions.createDownRotationLabelPositions( Double .parseDouble( rotationAngle.getText() ) ) ); } } }
CategoryLabelPositions.createDownRotationLabelPositions((labelRotation / 180.0) * Math.PI));