2012-07-24 3 views
1

tChart에서 IGraphics3D를 사용하는 데 문제가 있습니다. tChart를 통해 모든 유형의 그림을 그릴 수 있지만 getImage()를 사용하여 파일을 그리면 도면이 사라집니다. 차트 위로 마우스를 클릭하면이 그림도 사라집니다. "com.steema.teechart.tools.Annotation"도 사용하고 있으며 원하는 방식으로 작동합니다. 그러나 나는 왜 Graphics3D가 다른 행동을하는지 모른다.TeeChart에서 Graphics3D 그리기

은 내가 도면을 만드는 방법을 보여주는 코드를 복사 :

IGraphics3D grafics = tChart.getGraphics3D(); 
grafics.getPen().setColor(liniaGrafica.getColorLinia()); 
Series serie = tChart.getSeries(liniaGrafica.getIndexSerie()); 
grafics.line(X1, Y, X2, Y); 

사람이 그 의심의 여지를 도와 줄 수 있습니다.

미리 감사드립니다.

+0

자바 버전을 사용하고 있습니까? 환경 태그를 추가하십시오. – Yeray

답변

1

참고 chartPainted 이벤트에서 사용자 지정 드로잉 루틴을 호출해야합니다. 여기에 예제가 있습니다 :

private static void initializeChart() { 
    tChart1.getAspect().setView3D(false); 
    Area area1 = new Area(tChart1.getChart()); 
    area1.fillSampleValues(100); 

    tChart1.addChartPaintListener(new ChartPaintAdapter() { 
     @Override 
     public void chartPainted(ChartDrawEvent e) { 
      IGraphics3D grafics = tChart1.getGraphics3D(); 
      grafics.getPen().setColor(tChart1.getSeries(0).getColor()); 
      grafics.line(0, 0, 100, 100); 
     } 
    }); 
}