开发者

Java Free Chart Question

I'm using JFreeChart to display data in my PC application (Java, Netbeans). I could not find a way to directly configure the horizontal axis to display like I wanted, so I attempted to build the display manually.

I did discover how to disable the display of tick labels (the numbers along the axes), but when I did that, JFreeChart helpfully moved the axes to the edge of the display area leaving me no room to draw my labels. Dang.

What I'm trying to accomplish is to display x-axis values ONLY at the left edge, the center, and the right edge. I'm willing to use whatever tool will get开发者_Go百科 this done, but so far I've had very little success.

If anybody knows how to do this directly with JFreeChart, or how to scootch the X-axis a few pixels up the screen so I can print the labels manually, I would sure appreciate the assistance.

Thank, R.


When you create a JFreeChart object, there should be a setPadding() method that allows you to define the space between the chart border and the actual chart area.

For example:

JFreeChart myChart = new ....;
myChart.setPadding(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜