Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Wrap or cut long labels in Pentaho CE Bar Chart Control

  1. #1
    Join Date
    May 2017
    Posts
    4

    Default Wrap or cut long labels in Pentaho CE Bar Chart Control

    How to cut long labels of the Bar Chart Control’s base axis? I have already tried to cut them in the Extension Points (baseAxisLabel_text):
    Code:
    function(a){    var str=this.scene.atoms.category.label;
        if (str.length>30){
            str=str.substring(0,30)+' ...';
        }
        return str;
    }


    However, it seems that Chart Control width is calculated taking into account old label length. Now I have white area at the left of my bars.
    I46hf.jpg

    How to solve this?

  2. #2
    Join Date
    May 2017
    Posts
    4

    Default

    Hi

    Solved using chart component's Base Axis Tick Formatter function

    Code:
    function(v){
        if (v.length > 15){
            v = v.substring(0,15)+' ...';
        }
        return v;
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2017 Pentaho Corporation. All Rights Reserved.