Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Calling user defined java script funtion from expression builder
Migrateduser
Hi every one,
I have a bar chart where some Amount(y-axis) vs Product(x-axis) is displayed. My requirement is to show the amount as tool tip on mouse over on any of the bars. I am able to give the tool tip but, I also need to format this text(amount) as currency.
I need to use the following java script function on the tool tip expression builder:
formatDollar(row["amount"])
function formatDollar(num) {
var p = num.toFixed(0);
var chars = p.split("").reverse();
var newstr = '';
var count = 0;
for (x in chars) {
count++;
if(count%3 == 1 && count != 1) {
newstr = chars[x] + ',' + newstr;
} else {
newstr = chars[x] + newstr;
}
}
return '$'+newstr;
}
Adding this entire code in the builder is not working. I think this function is not called. Please suggest any idea on how to call the function.
Thanks in advance,
Madhavi.
Find more posts tagged with
Comments
There are no comments yet