mcstoufer Posted April 15, 2008 Report Share Posted April 15, 2008 I am trying to generate a 'trend chart'. Attached is a small version. Part of the spec I have to work with is that there be NO visible border of any kind around the plot. As you can see, I have only the outside border line to remove. I have poured over the docs and do not see how this last bit is resolved. I am generating the image via JSF Managed Bean. The two related methods are below. public void setChartComp(com.softwarefx.chartfxfaces.component.Chart chartComp) { trend = chartComp; } public com.softwarefx.chartfxfaces.component.Chart getChartComp() { java.util.Random r = new java.util.Random(1); trend.setGallery(Gallery.LINES); trend.setMarkerShape(MarkerShape.NONE); SoftwareFX.ChartFX.DefaultBorder myBorder = new SoftwareFX.ChartFX.DefaultBorder(BorderType.NONE); myBorder.setColor(java.awt.Color.WHITE); trend.setBorderObject(myBorder); trend.setBackColor(java.awt.Color.WHITE); trend.setBottomGap(0); trend.setLeftGap(0); trend.setTopGap(0); trend.setRightGap(0);//Populating the chart with random data trend.openData(COD.VALUES, 1, 12); for (int j = 0; j < 12; j++) { trend.getValue().setItem(0, j, r.nextDouble() * 50); } trend.closeData(COD.VALUES); trend.getAxisX().setVisible(false); trend.getAxisY().setVisible(false); return trend; } Quote Link to comment Share on other sites More sharing options...
mcstoufer Posted April 15, 2008 Author Report Share Posted April 15, 2008 I've made some progress here. I have removed the inner border but can't figure out how to change the bounding rectangle so it consumes the entire area of the image. This is now related to the previous thread on maximizing plot space in a chart. Here is the updated getChartComp() method that has the improvements: Note the "setAxesStyle" call. public com.softwarefx.chartfxfaces.component.Chart getChartComp() { java.util.Random r = new java.util.Random(1); trend.setGallery(Gallery.LINES); trend.setMarkerShape(MarkerShape.NONE); trend.setAxesStyle(AxesStyle.NONE); SoftwareFX.ChartFX.DefaultBorder myBorder = new SoftwareFX.ChartFX.DefaultBorder(BorderType.NONE,java.awt.Color.WHITE); trend.setBorderObject(myBorder); trend.setBackColor(java.awt.Color.WHITE); trend.setBottomGap(0); trend.setLeftGap(0); trend.setTopGap(0); trend.setRightGap(0); trend.openData(COD.VALUES, 1, 12); for (int j = 0; j < 12; j++) { trend.getValue().setItem(0, j, r.nextDouble() * 50); } trend.closeData(COD.VALUES); trend.getAxisX().setVisible(false); trend.getAxisY().setVisible(false); return trend; } Quote Link to comment Share on other sites More sharing options...
mcstoufer Posted April 15, 2008 Author Report Share Posted April 15, 2008 I found that the following stretched things out: trend.setBottomGap(-1); trend.setLeftGap(-2); trend.setTopGap(-1); trend.setRightGap(-2); I could not find this "feature" documented anywhere. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.