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

Friday, 31 October 2014

Tip : Tree Map Example : Display colors of groups based on condition.








function f() {
    var colorScale;

    var cd = this.chartDefinition;
    cd.legend = false;

    cd.leaf_fillStyle = function(scene) {
        /*
        if(!colorScale) {
            colorScale = pv.ramp('red', 'blue');
           
            var extent = this.chart.data.dimensions('size').extent();
            if(extent)
                colorScale.domain(extent.min.value, extent.max.value);
        }
 */      
        // Is colorScale created ?
    if(!colorScale) {
        colorScale = pv.Scale.linear().range("red", "black", "blue","#708090");
   
        var extent = this.chart.data.dimensions('size').extent();
        if(extent) {
            var min  = extent.min.value;
            var b=500;
            var c=1000;
            var max = extent.max.value;

            //colorScale.domain(min, (min + max) / 2, max);
            colorScale.domain(min,b,c,max);
        }
        }
       
        var size = scene.getSize();
        return colorScale(size);
    };
}