sayan_maity Posted September 18, 2007 Report Share Posted September 18, 2007 I created one pie chart. The Pie itself is coming in small size. Near the boudaries lots of spaces were left. How to maximize those space so that the pie looks big? Quote Link to comment Share on other sites More sharing options...
sayan_maity Posted September 18, 2007 Author Report Share Posted September 18, 2007 Hi, I want to set the color of the different slices of the Pie. I want to have some customized colors. Please let me know how to have my own colors in the Pie slices? Thanks and regards, Sayan Maity Quote Link to comment Share on other sites More sharing options...
GabrielA Posted September 18, 2007 Report Share Posted September 18, 2007 It is difficult to say without seeing an image of you Pie. For example, the following code will produce the attached Pie, which doesn't have a lot of space left around. <%ChartServer chart1 = new ChartServer(application,request,response);chart1.setGallery(Gallery.PIE);chart1.openData(COD.VALUES, 1, 3);chart1.getValue().setItem(0, 0, 20);chart1.getValue().setItem(0, 1, 45);chart1.getValue().setItem(0, 2, 30);chart1.closeData(COD.VALUES);%><%=chart1.getHtmlTag("400","400","PNG")%> You can adjust the gap around the pie by calling the setGaps method. i.e. the following code will set the gaps all around to 1 pixel: chart1.setGaps(new java.awt.Rectangle(1,1,1,1)); Quote Link to comment Share on other sites More sharing options...
GabrielA Posted September 18, 2007 Report Share Posted September 18, 2007 You can do that by setting the individuals point attributes, i.e: chart1.getPoint(0,1).setColor(java.awt.Color.ORANGE); Quote Link to comment Share on other sites More sharing options...
sayan_maity Posted September 19, 2007 Author Report Share Posted September 19, 2007 Hi, I tried the code provided by you to set the color of a pie section. But it is giving an error which is a follows: java.lang.NoClassDefFoundError: SoftwareFX/ChartFX/Map/DefaultAttributes at SoftwareFX.ChartFX.PointAttributesCollection.getItem(Unknown Source) at SoftwareFX.ChartFX.ChartCore.getPoint(Unknown Source)at com.novartis.CHartFX.PieChart.main(PieChart.java:49) Exception in thread "main" Please find the attached code to generate the Pie Chart. Thanks and regards, Sayan Maity Quote Link to comment Share on other sites More sharing options...
GabrielA Posted September 20, 2007 Report Share Posted September 20, 2007 I have just copied and pasted your code and it works fine. I've change the Color.ORANGE to Color.CYAN and this is the image I've got. 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.