anamika Posted April 23, 2008 Report Share Posted April 23, 2008 I have a 3D Gantt chart. On Y axis labels appear exactly on tick marks. How can I get them in centre i.e. in between two tick marks? I have following code and chart: axisY.setMin(minAxisY); axisY.setMax(maxAxisY); axisY.setStep(stepAxisY); axisY.setGridlines(true); axisY.getGrid().setColor(Color.GREY); axisY.setTickMark(TickMark.INSIDE); axisY.getLine().setColor(Color.GREY); axisY.setTextColor(Color.GREY); axisY.setFont(new Font("Arial", Font.PLAIN, 8)); chart.getAxisX().getLine().setColor(Color.GREY)); chart.getAxisX().setVisible(false); chart.setBackColor(Color.WHITE); chart.setBorder(false); chart.setScheme(Scheme.SOLID); chart.setGallery(Gallery.GANTT); chart.setChart3D(false); chart.setRightGap(10); chart.setLeftGap(10); chart.setTopGap(10); chart.setBottomGap(10); chart.setBorderObject(new DefaultBorder(BorderType.NONE)); Link to comment Share on other sites More sharing options...
mcstoufer Posted May 1, 2008 Report Share Posted May 1, 2008 Roughly, Set your current major gridlines as minor gridlines with a spacing of n/2 where n is the interval currently being displayed. Make their color and tick mark both the same color as your plotting area background. This will hide them but still render the minor axis labels. Then turn on your minor axes and set them to the color that is currently displayed. No labels are requied on these new minors. Good luck. Link to comment Share on other sites More sharing options...
Frank Posted May 1, 2008 Report Share Posted May 1, 2008 There is an easier way: There is a flag ins the AxisStyle (AxisStyle.Centered) that will do just that. I don't know exactly what the JAVA code will be but it must be something like: chart.getAxisY().setStyle(chart.getAxisY().getStyle() | AxisStyle.Centered); Link to comment Share on other sites More sharing options...
mcstoufer Posted May 2, 2008 Report Share Posted May 2, 2008 I agree, that is much easier! Link to comment Share on other sites More sharing options...
anamika Posted June 3, 2008 Author Report Share Posted June 3, 2008 Thank You. It worked. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.