JFreeChar解决中文乱码问题

// 通用的中文问题解决方案
   StandardChartTheme theme = new StandardChartTheme("unicode") {  
      public void apply(JFreeChart chart) {  
          chart.getRenderingHints().put(RenderingHints.KEY_TEXT_ANTIALIASING,  
                  RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);  
          super.apply(chart);  
      }  
   };  
   theme.setExtraLargeFont(new Font("宋体", Font.PLAIN, 14));  
   theme.setLargeFont(new Font("宋体", Font.PLAIN, 14));  
   theme.setRegularFont(new Font("宋体", Font.PLAIN, 12));  
   theme.setSmallFont(new Font("宋体", Font.PLAIN, 10));  
   ChartFactory.setChartTheme(theme); 
 

 

你可能感兴趣的:(中文乱码)