Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
boney - 15 Dec 2006 11:25 GMT
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();

     }               

    }
Lew - 15 Dec 2006 14:24 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.