2013-10-21 3 views
1

다중 축 차트 막대 문자 및 선형 차트가 있습니다. 내 커스터마이징 클래스에는 다음 코드 스 니펫이 있습니다. 비늘이 엉망와 같은 줄에 있지된다 재스퍼 다중 축 차트 사용자 정의 배율

enter image description here

처럼

@Override 
    public void customize(final JFreeChart chart, final JRChart jasperChart) { 

     final Plot plot = chart.getPlot(); 

     if (plot instanceof CategoryPlot) { 
      final CategoryPlot cPlot = (CategoryPlot) plot; 
      final ValueAxis axis = new NumberAxis(); 
      axis.setMinorTickMarksVisible(true); 
      axis.setMinorTickCount(1); 
      cPlot.setRangeAxis(axis); 
     } else if (plot instanceof XYPlot) { 
      final XYPlot xyPlot = (XYPlot) plot; 
      xyPlot.setRangeMinorGridlinesVisible(true); 

     } 

    } 

차트 보인다.

이 문제는 어떻게 해결할 수 있습니까?

도움을 주시면 감사하겠습니다.

감사

답변

1

는 다음과 그 모든 좋은에 위의 코드를 변경

@Override 
    public void customize(final JFreeChart chart, final JRChart jasperChart) { 

     final Plot plot = chart.getPlot(); 

     if (plot instanceof CategoryPlot) { 
      final CategoryPlot cPlot = (CategoryPlot) plot; 
      cPlot.getRangeAxis().setMinorTickCount(2); 
      cPlot.getRangeAxis().setMinorTickMarksVisible(true); 
     } else if (plot instanceof XYPlot) { 
      final XYPlot xyPlot = (XYPlot) plot; 
      xyPlot.setRangeMinorGridlinesVisible(true); 
      xyPlot.getRangeAxis().setMinorTickCount(2); 
      xyPlot.getRangeAxis().setMinorTickMarksVisible(true); 

     } 

    }