Pentaho Tools :

Pentaho C-Tools(CDE,CDF,CDA),Pentaho CE & EE Server,OLAP-Cubes,Analysis using Pivot4J, Saiku Analytics, Saiku Reporting, Ad-hoc Reporting using Interactive Reporting Tool,Dashboards,Reports using PRD, PDD,Data Integration using Kettle ETL,Data Mining usign WEKA,Integration of Servers with Databases,Mobile/iPad compatible Dashboards using Bootstrap Css,Drilldown dashboards,Interactive Dashboards

Tuesday 5 November 2013

Adding dollar($) sign to X-axis lables(values) for bar charts in pentaho CDE

Hi Guys,
Using below java script one can easily add '$' sign to the values of X-axis for any charts in pentaho CDE.
Example:
function f(v) { return "$" + sprintf('%d', v/1000) + 'k'; }


Write the java code in "orthoAxisTickFormatter" java script wizard.
Make sure to give orthoAxisTicks as "True"

Sample output:


NOTE:
This code works with 13.06 as well with 13.09 version of pentaho CDE.
Also note that in java script if one line is not executing then the remaining lines will not execute. i.e., for instance you have 10 lines of code and 4th line is not executed then the remaining lines will not execute. Check with an alert function.


Sadakar Pochampalli
BI developer

No comments:

Post a Comment