Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8322353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:21:41+00:00 2026-06-08T23:21:41+00:00

I am currently migrating an application from a windows environment to a Redhat one.

  • 0

I am currently migrating an application from a windows environment to a Redhat one. This application is using JfreeChart 1.0.6. It is a web app deployed in a tomcat 7 on a Redhat headless environment running on a Open-JDK6).

I obtain the following PNG. It looks like handwrited chart and everything is shifted towards the top of the image.

Did someone already encounter such issue and got a fix?

See my chart below :

image http://img194.imageshack.us/img194/4489/graph20120801105017.png

See below the piece of code generating the chart :

FacesContext facesContext = FacesContext.getCurrentInstance();
    ServletContext servlet = (ServletContext)facesContext.getExternalContext().getContext();
    HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
    String path = null;

    if (null != servlet.getRealPath("/"))
    {
        path = servlet.getRealPath("/");
    }
    else
    {
        path = servlet.getResource("/").getPath();
    }

    File stockageImg = new File(path+Constants.CHEMIN_GRAPH+CM50Util.dateHeureJour()+Constants.EXTENSION_GRAPH);

    ChartRenderingInfo info = new ChartRenderingInfo (new StandardEntityCollection());
    DefaultXYDataset dataset = new DefaultXYDataset();
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);

    try 
    {
        dataset.addSeries("CM moyen Annuel", courbeRef);
        dataset.addSeries("CM non dépassé plus de 5% du temps", courbe95);

        //creation du graphique
        JFreeChart chart = ChartFactory.createXYLineChart(
             "Courbes de décroissance",
             "Distance en m\u00E8tre",
             "Champ",
             dataset,
             PlotOrientation.VERTICAL,
             true,
             false,
             false);

        XYPlot plot = (XYPlot) chart.getPlot();
        plot.setRenderer(renderer);

        IntervalMarker intervalIncertitude = new IntervalMarker(Double.parseDouble(resultDistanceMin.replace(Constants.UNITE_DISTANCE, "")), Double.parseDouble(resultDistanceMax.replace(Constants.UNITE_DISTANCE, "")));
        intervalIncertitude.setPaint(new Color(222, 222, 255, 128));
        plot.addDomainMarker(intervalIncertitude, Layer.BACKGROUND);

        Marker distanceTiers = new ValueMarker(Double.parseDouble(resultDistance.replace(Constants.UNITE_DISTANCE, "")));
        distanceTiers.setPaint(Color.BLACK);
        plot.addDomainMarker(distanceTiers);

        renderer.setSeriesPaint(0, Color.GREEN);
        renderer.setSeriesPaint(1, Color.BLUE);

        ChartUtilities.saveChartAsPNG(stockageImg, chart, 800, 400, info);

    } catch (Exception e) {
            log.error("erreur generation graphique ",e);
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:21:43+00:00Added an answer on June 8, 2026 at 11:21 pm

    I found the cause of the problem :

    • I logged the font use by JfreeChart : it was SansSerif.plain
    • Looking into OpenJDK, in the file fontconfig.properties, I found :

    sansserif.plain.latin-1=DejaVu LGC Sans

    filename.DejaVu_LGC_Sans=/usr/share/fonts/dejavu-lgc/DejaVuLGCSans.ttf

    I didnt have this font installed on my machine, so I installed it and it went fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am migrating an application from ASP.NET Web Forms to ASP.NET MVC 3. One
We are currently in the process of migrating our application from our production environment
I'm currently working on migrating an application from MS-Access to MS SQL Server. In
I'm currently migrating my sqllite application to using core data. When I created the
I'am currently migrating an iphone application using SQLite to CoreData. I need to do
I'm currently migrating a legacy JSF 1.2 application using RichFaces 3.3 to JSF 2.0
I'm in the process of migrating portions of an application from Windows Forms to
Hi guys I am migrating an application using hibernate from xml to JPA annotations.
I'm currently migrating an application from GMaps V2 to V3. As I use OSM
Currently We are facing a lot of problem in migrating our Application from Hibernate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.