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

B

boney

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();

}

}
 
L

Lew

boney said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top