Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Truncate label in CCC Bar Chart

  1. #1
    Join Date
    May 2017
    Posts
    2

    Default Truncate label in CCC Bar Chart

    Hi,
    I'm trying to truncate labels in a bar chart.
    I set the extension point "xAxisLabel_text" to this function:
    Code:
    function(d) {
        return substringX(d);}
    substringX is defined as:
    Code:
    function substringX(d){
        return d.substring(0,10);
    }
    But I get no result and it prints "TypeError: d.substring is not a function". It looks like the object in input to the function is not a string.
    What am i doing wrong? Did you know alternative methods to get the label truncation?

    Thanks in advance.
    A.

  2. #2
    Join Date
    May 2017
    Posts
    2

    Default Truncate label in CCC Bar Chart

    Hi,
    I'm trying to truncate labels in my CCC Bar Chart using extension point xAxisLabel_text that I've setted to the function:
    Code:
    function(d) {
        return substringX(d);}
    Function substringX is defined as:
    Code:
    function substringX(d){
        return d.substring(0,10);
    }
    But I'm getting nothing and an error in console: "TypeError: d.substring is not a function". It looks like the object in input to my function is not a string.
    What am I doing wrong? Is there any other alternative method to get labels truncate to a fixed dimension?

    Thanks in advance,
    A.

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 - 2019 Hitachi Vantara Corporation. All Rights Reserved.