本文整理汇总了Java中org.jfree.chart.axis.Axis.setFixedDimension方法的典型用法代码示例。如果您正苦于以下问题:Java Axis.setFixedDimension方法的具体用法?Java Axis.setFixedDimension怎么用?Java Axis.setFixedDimension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.axis.Axis
的用法示例。
在下文中一共展示了Axis.setFixedDimension方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureAxis
import org.jfree.chart.axis.Axis; //导入方法依赖的package包/类
/**
* Sets all the axis formatting options. This includes the colors and fonts to use on
* the axis as well as the color to use when drawing the axis line.
*
* @param axis the axis to format
* @param labelFont the font to use for the axis label
* @param labelColor the color of the axis label
* @param tickLabelFont the font to use for each tick mark value label
* @param tickLabelColor the color of each tick mark value label
* @param tickLabelMask formatting mask for the label. If the axis is a NumberAxis then
* the mask should be <code>java.text.DecimalFormat</code> mask, and
* if it is a DateAxis then the mask should be a
* <code>java.text.SimpleDateFormat</code> mask.
* @param verticalTickLabels flag to draw tick labels at 90 degrees
* @param lineColor color to use when drawing the axis line and any tick marks
* @param isRangeAxis used to distinguish between range and domain axis type
* @param timeUnit time unit used to create a DateAxis
*/
protected void configureAxis(
Axis axis,
JRFont labelFont,
Color labelColor,
JRFont tickLabelFont,
Color tickLabelColor,
String tickLabelMask,
Boolean verticalTickLabels,
Paint lineColor,
boolean isRangeAxis,
Comparable<?> axisMinValue,
Comparable<?> axisMaxValue
) throws JRException
{
Boolean axisVisible = (Boolean)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_VISIBLE);
if (axisVisible != null && axisVisible.booleanValue())
{
setAxisLine(axis, lineColor);
Double defaultFixedDimension = (Double)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_FIXED_DIMENSION);
if (defaultFixedDimension != null)
{
axis.setFixedDimension(defaultFixedDimension.doubleValue());
}
Integer baseFontSize = (Integer)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BASEFONT_SIZE);
setAxisLabel(axis, labelFont, labelColor, baseFontSize);
setAxisTickLabels(axis, tickLabelFont, tickLabelColor, tickLabelMask, baseFontSize);
setAxisTickMarks(axis, lineColor);
String timePeriodUnit = isRangeAxis
? (String)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.RANGE_AXIS_TIME_PERIOD_UNIT)
: (String)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.DOMAIN_AXIS_TIME_PERIOD_UNIT);
setAxisBounds(axis, isRangeAxis, timePeriodUnit, axisMinValue, axisMaxValue);
if (verticalTickLabels != null && axis instanceof ValueAxis)
{
((ValueAxis)axis).setVerticalTickLabels(verticalTickLabels.booleanValue());
}
}
else
{
axis.setVisible(false);
}
}