Japanese Text not displayed on Image Generated by Servlet on winXP, Linux but displayed on Win2000

Discussion in 'Java' started by boney, Dec 15, 2006.

  1. boney

    boney Guest

    hello All,

    I have developed a web App sample (project Proposal Purpose) that
    creates various Charts (bar, pie, time series...) using JFreeChart API.

    I need to have Japanese text in all the labels of the Chart.

    I gave hard coded Japanese text to the method that creates the chart
    for diagnosis Purpose.

    The problem is the Image of the Chart that is created has Japanese text
    in the Labels on Win2000 Pro. But the Same application when deployed to
    winXP and also on Fedora Core 6 does not have Japanese Text on the
    Labels. it just has '???' in place of the text.

    I am using J2sdk1.4.2, Tomcat 5.0.28 on all the 3 machines(win2000,
    winXP, Fedora Core 6)
    If the API doesnt support Japanese Input then the Labels shouldn't have
    displayed Japanese text on win2000. Hence Can this be related to Tomcat
    or JRE ???



    My Servlet Code is as follows:

    protected void doPost(HttpServletRequest request, HttpServletResponse
    response) throws ServletException, IOException {

    try {


    DefaultCategoryDataset objDataset = new DefaultCategoryDataset();


    String Series[] = {"’j«","—«"};

    String Category[] = {"ƒ€ƒ“ƒoƒC", "ƒfƒŠ[",
    "ƒA[ƒ}ƒ_ƒo[ƒh"};

    objDataset.addValue( new Double( 7000.0 ),Series[0] ,Category[0]
    );

    objDataset.addValue( new Double( 8000.0 ),Series[1] ,Category[0]
    );

    objDataset.addValue( new Double( 9000.0 ),Series[0] ,Category[1]
    );

    objDataset.addValue( new Double( 8000.0 ),Series[1] ,Category[1]
    );

    objDataset.addValue( new Double( 11000.0 ),Series[0] ,Category[2]
    );

    objDataset.addValue( new Double( 13000.0 ),Series[1] ,Category[2]
    );

    JFreeChart objChart = null;

    objChart = ChartFactory.createBarChart(

    "’j«/—« Š„‡", //chart title

    "’¬", //X Axis label

    "lΞ", //Y Axis Label

    objDataset,

    PlotOrientation.HORIZONTAL, //plot orientation (Horizontal
    Bar or Veritcal Bar)

    true, // Is a legend required?

    true, // Use tooltips

    false // Configure chart to generate URLs?

    );

    HttpSession objSession = request.getSession();

    ChartRenderingInfo objChartRenderingInfo = new
    ChartRenderingInfo(new StandardEntityCollection());

    String strFileName =
    ServletUtilities.saveChartAsPNG(objChart,500,500,objChartRenderingInfo,objSession);

    request.getSession().setAttribute("FileName",strFileName);



    RequestDispatcher objDispatcher = null;

    objDispatcher =
    getServletContext().getRequestDispatcher("/MyDisplayChart?filename=" +
    strFileName);

    objDispatcher.forward(request,response);
    } catch(Exception ex) {

    ex.printStackTrace();

    }

    }
     
    boney, Dec 15, 2006
    #1
    1. Advertising

  2. boney

    Lew Guest

    Re: Japanese Text not displayed on Image Generated by Servlet onwinXP, Linux but displayed on Win2000

    boney wrote:
    > The problem is the Image of the Chart that is created has Japanese text
    > in the Labels on Win2000 Pro. But the Same application when deployed to
    > winXP and also on Fedora Core 6 does not have Japanese Text on the
    > Labels. it just has '???' in place of the text.


    Perhaps you do not have a font installed on the other two machines that is
    compatible with the font used to create the chart.

    - Lew
     
    Lew, Dec 15, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Elton  Sir Sanjiyan  Sanchez
    Replies:
    4
    Views:
    546
  2. Arjunan  Venkatesh
    Replies:
    2
    Views:
    408
    Arjunan Venkatesh
    Mar 15, 2005
  3. WilOJoe
    Replies:
    2
    Views:
    545
    WilOJoe
    Dec 10, 2003
  4. Fabricio Sperandio

    Problems! WinNT Client -> WinXP Web Server -> Win2000 File Server

    Fabricio Sperandio, Apr 6, 2004, in forum: ASP .Net Security
    Replies:
    1
    Views:
    187
    Ken Schaefer
    Apr 6, 2004
  5. kpowell10
    Replies:
    4
    Views:
    199
    Ben Morrow
    May 7, 2004
Loading...

Share This Page