Active-X.COM Posted September 24, 2007 Report Share Posted September 24, 2007 I have a simple Pie (Donut) chart with the following Code: Set Chart1 = Server.CreateObject("ChartFX.ASP.Server") Set axis = Chart1.Axis(0) Set title = axis.Title title.Flags = TitleFlag_DrawingArea Or TitleFlag_NoChangeDockArea Chart1.PointLabels = true Chart1.Chart3D = true Chart1.LegendBox = true Chart1.Gallery = Gallery_Doughnut Chart1.OpenData COD_Values, 1, 4 Chart1.Value(0, 0) = sngTotal1 Chart1.Value(0, 1) = sngTotal2 Chart1.Value(0, 2) = sngTotal3 Chart1.Value(0, 3) = sngTotal4 Chart1.CloseData(COD_Values) I expect a 4-segment pie with the percentages displayed, based on the totals I give. I am not supplying the percentage values. I am supplying the totals. Can the pie chart take the totals and display the percentages or do I have to supply the percentage values? Quote Link to comment Share on other sites More sharing options...
maried Posted September 25, 2007 Report Share Posted September 25, 2007 You can use the PointLabelMask to display the percentage of total this point represents for a pie chart. chart1.PointLabelMask = "%p" Please refer to the API documentation in the Resource Center for more information on the different options for the PointLabelMask. You can also use the TipMask property of the chart object to display as tooltip when user places cursor over a particular point in the chart. Quote Link to comment Share on other sites More sharing options...
Active-X.COM Posted September 25, 2007 Author Report Share Posted September 25, 2007 Well, that didn't really answer my question, which was "Can the pie chart take the totals and display the percentages or do I have to supply the percentage values?". But it was related enough to get the end result. The answer seems to be "Yes, you can supply the values rather than the percentages". If I am misled, please let us all know. I have to say the documentation is not very clear on how to go about doing many of the things the chart component can do. One more question: My chart seems to display correctly now. However (using the same code above), the pie values in the legend read "Value #1, Value #2, Value #3, and Value #4". How do I change these to read the correct labels for each value? Again, I can't seem to find it in the documentation and trust me, I've looked! Thanks! Quote Link to comment Share on other sites More sharing options...
maried Posted September 25, 2007 Report Share Posted September 25, 2007 You need to set the point legend as follows: Chart1.LegendBox = True Chart1.Legend(0) = "January" Chart1.Legend(1) = "February" .... .... You can also refer to Chartfx Resource Center programmer's guide > Legends > Points Legend section. Quote Link to comment Share on other sites More sharing options...
Active-X.COM Posted September 25, 2007 Author Report Share Posted September 25, 2007 Ahhh, yes. Thank you! 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.