Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1023 Display problems on 64-bit system

1.0.x
open
nobody
General (896)
5
2010-11-25
2010-11-24
Daehler
No

On one of our systems, BOLD range axis labels are not displayed correctly.
If the labels are not BOLD, everything works fine.

The problem occurs on the following system:
RHEL 5 64-Bit
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6) (rhel-1.13.b16.el5-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

On our windows and 32-bit Linux systems the problem does not occur.

JFreeChart Version: 1.0.13

Java Code:
TimeSeries brSerie = new TimeSeries("Test");

brSerie.add(new Month(1, 2010), 100);
brSerie.add(new Month(2, 2010), 400);
brSerie.add(new Month(3, 2010), 300);

TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(brSerie);

DateAxis xAxis = new DateAxis();
Calendar start = Calendar.getInstance();
start.setTime(new Month(1, 2010).getStart());

Calendar end = Calendar.getInstance();
end.setTime(new Month(3, 2010).getStart());

xAxis.setRange(start.getTime(), end.getTime());
xAxis.setTickUnit(new DateTickUnit(DateTickUnitType.MONTH, 1));
xAxis.setDateFormatOverride(new SimpleDateFormat("M/yy"));
xAxis.setLabel("Months");

NumberAxis brAxis = new NumberAxis();
brAxis.setRange(0, 500);
brAxis.setLabel("The Y axis is not displayed correctly");
brAxis.setLabelFont(new Font("SansSerif", Font.BOLD, 15));

XYPlot plot = new XYPlot();
plot.setDataset(dataset);
plot.setDomainAxis(xAxis);
plot.setRangeAxis(brAxis);

XYLineAndShapeRenderer brRenderer = new XYLineAndShapeRenderer();
brRenderer.setSeriesStroke(0, new BasicStroke(2));
plot.setRenderer(brRenderer);

JFreeChart chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT, plot, false);

try
{
ChartUtilities.saveChartAsPNG(new File("img.png"), chart, 600, 400);
}
catch (IOException e)
{
System.err.println("Failed to render chart as png: " + e.getMessage());
e.printStackTrace();
}

Discussion

  • Daehler
    Daehler
    2010-11-24

    Image

     
    Attachments
  • Daehler
    Daehler
    2010-11-25

    • summary: Vertical BOLD labels on 64-bit system --> Display problems on 64-bit system
     
  • Daehler
    Daehler
    2010-11-25

    There are more display problems on the 64-bit system, not only with bold labels.