vivekmehtani Posted September 16, 2008 Report Share Posted September 16, 2008 Hi, How can i change the Pie Chart Legend Color of points in 7.0 version Please suggest ? Thanks, Vivek Quote Link to comment Share on other sites More sharing options...
jmeessem Posted January 27, 2009 Report Share Posted January 27, 2009 Has anyone figured out how to do this yet? I can set the colors of the seperate slices easily, but those color changes are NOT represented in the Legend. Quote Link to comment Share on other sites More sharing options...
AndreG Posted January 28, 2009 Report Share Posted January 28, 2009 There is a difference between the legend box shown in a Pie chart and in a Bar chart (for instance). In a Bar chart (and most other types of charts) each item in the legend box represents a Series, while in a Pie chart each item represents a Point. To change the color of a slice in a Pie and have your change be reflected in the legend box, try the following sample. ChartServer chart1 = new ChartServer(pageContext,request,response);chart1.getData().setSeries(1);chart1.getData().setPoints(4);java.util.Random r = new java.util.Random(1);for (int i = 0; i < chart1.getData().getPoints(); i++){ for (int j = 0; j < chart1.getData().getSeries(); j++) { chart1.getData().set(j, i,r.nextDouble()* 80); }}chart1.setGallery(Gallery.PIE);chart1.getPoints().get(0).setColor(java.awt.Color.LIGHT_GRAY);chart1.renderControl(); Quote Link to comment Share on other sites More sharing options...
Samuel Posted June 26, 2009 Report Share Posted June 26, 2009 How to do the same with c#.Net Quote Link to comment Share on other sites More sharing options...
AndreG Posted June 26, 2009 Report Share Posted June 26, 2009 chart1.Data.Series = 1;chart1.Data.Points = 4;Random r = new Random();for (int i = 0; i < chart1.Data.Points; i++){ for (int j = 0; j < chart1.Data.Series; j++) { chart1.Data[j, i] = r.Next() * 80; }}chart1.Gallery = Gallery.Pie;chart1.Points[0].Color = Color.LightGray; 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.