Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pie chart format point label values

Status
Not open for further replies.

garry1

Programmer
Dec 6, 2002
49
US
Hi, I need to format label values on the pie chart to show two decimal places example 12.22. When I select Point label style as Numeric it is displaying as 12.2.
and also Is it possible to show label value and percentage.
Thanks.
 
Override the Finish( ) method of the chart:

Sub Finish( )
Super::Finish( )
Dim i as Integer
Dim j as Integer

For j = 0 to DataSetCount - 1
For i = 0 to PointCount - 1
Points(0, i).Label = Format$(Points (0, i).Y, "#,##0.00")
Next
Next

End Sub
 
I made the changes you mentioned above. I copied the above code to the chart sub finish method. It is formating to two decimal palces but it is displaying all values as 0.00. I think I am doing something wrong. How to fix this.
Thanks so much.
 
I played around with the example pie chart report and was able to get the points to display correctly -- which uses integer values, not doubles -- as 1234.00 You can change the Format to "#,###.00, but you have to have the ".00" to force the place holder in case there is just one value past the decimal point (or no values to the right of the decimal).

You may need to change the PointLabelStyle from numeric to Text. Other than that, it must be somewhere else, possibly your data or your value expression(s).
 
Whenever I change the PointLableStyle to "ChartTextLabels" it doesn' take the values from YValue expression anymore but it takes from the X value expression. Where am I going wrong?

Thanks.
 
If you can send me your design (don't forget any and all libraries) I might be able to take a look:

bcaslow@hotmail.com
 
I have emailed you a sample design. Also plz let me know ur inputs on the other thread I have posted with the title "Bar Graphs - Point Labels".
Thanks.

Ravi
 
Ravi,

Yes, I got the attachment in me email, but after looking at it and running it, I guess I'm not sure of your problem. One exception is that I opened it in version 7 of Actuate. However, the graph displays the correct values as point labels: 520106.00 and 542296.00. I overrode the OnRead of the data row and added some fractional part to the values, and again the values displayed correctly on the graph.

Is there some other issue, or am I missing something? I apologize if I am. I can load it on my laptop later as I have version 6 on it. I probably can't get to that for another day or so. In the meantime, if you could let me know more specifically what is wrong with the example you sent and what you are trying to get for an end result.


Bill
 
Ravi,

I just took a quick look again. On the pie chart, if what you're looking for is numeric point labels for the values of the pie slices, and you want the legend to specify each Status, then you should be using a Summary chart, not a detail chart.

Summary chart properties would be:
- CategoryExp: [OrderTotals.status]
- CategoryLabelExp: [OrderTotals.status]
- YValueExp: Sum([[OrderTotals.OrderTotal])
- PointLabelStyle: ChartNumericLabels

ALL summary charts have to have an equation, such as Sum( ) in the ValueExp field. Try these above properties on your example with a summary chart and let me know if this is what you wanted.

You may also need to do the same for your bar graph. If not, let me know.


Bill
 
Hi,
Thx for ur response. But the pie chart doesn' show the correct format. It always shows one decimal if I use numeric labels. If I use text labels, it shows orders.status in the label (Closed and InEvaluation) not the numeric values.
I think it is showing correctly in version 7.
But I just did something similar for bar charts and its working. This is what I did:

FOR i = 0 to PointCount Step 1
Points(0,i).Label = Format( Points(0,i).Y, "0.00" )
NEXT

Thanks.
 
I just observed it using a break point. The Points(0,i).Label is showing the correctly formatted numeric value. But on the graph it shows "Closed" and "InEvaluation" instead of the numeric values.
Is it a bug in Actuate?
Thanks.
 
I really didn't use version 6; I mainly went from 5 to 7, altho' I do remember reading some posts about bugs in the charts objects in version 6. It might depend on which SP and fix you're running. You can always check with Actuate Support.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top