Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Tooltip in Bullet Chart (CCCv2)

  1. #1

    Default Tooltip in Bullet Chart (CCCv2)

    I would like to display certain values for my bullet chart tooltip. I notice, however that you cannot use the same kind of methods to get the values. For example, the following doesn't work (and probably b/c it doesn't make sense in the case of a bullet chart):

    function(scene){
    return scene.vars.category.value;
    }

    How can I extract the values from the tooltip that hold the title, subtitle, mark1, mark2, and maximum in a function under tooltipFormat setting for the BulletChart type in CCCv2?

    Thank you!

  2. #2

    Default

    I found that you can get the title, subtitle, and value simply through the function in tooltipformat:
    function(title, subtitle, value){return title+subtitle+value;}

    However, I still cannot figure out how to get the value of the first mark, the second mark, and the maximum?

    Thanks

  3. #3

    Default

    I've realized now that you can actually get all of the values by getting
    this.chart.resultset[this.index][index_of_whichever_column_in_the_resultset_you_need]

    in other words, getting the entire resultset and using the appropriate indeces to obtain the value that is needed.

  4. #4
    Join Date
    Mar 2012
    Posts
    645

    Default

    Hi Marina,

    great progresses!


    The Bullet and the Parallel Coordinates charts were only updated enough to continue working inCCCv2; a few bug fixes were also addressed.
    That's why you don't have the CCCv2's usual signature in extension points, tooltipFormat, and others. What you see are leftovers of CCC's dark ages :-)

    You can directly get all the data you need if you override the "bulletMeasure_tooltip" and "bulletMarker_tooltip" extension points:

    Code:
    bulletMeasure_tooltip: function(measure, d) {    return d.title + " " + d.subtitle + " " + d.value;
    },
    bulletMarker_tooltip: function(marker, d) {    return d.title + " " + d.subtitle + " " + d.value;
    },
    The structure of the object passed in the above "d" arguments is:
    Code:
    {
       title: ...
       formattedTitle: ...,
       subtitle: ...,
       formattedSubtitle: ...,
       ranges: [...],
       measures: [...],
       markers: [...]
    }

  5. #5
    Join Date
    Feb 2013
    Posts
    3

    Default

    A lot thank duarte.leao, it works fine. However d.value is undefined (Community Chart Components 14, pentaho BA Server 5), so I have used d.measures[0] and d.markers[0], respectively.

    Extension point bulletMeasure_tooltip :

    function(measure, d) { return d.title + " " + d.subtitle + " " + d.measures[0];}
    }

    CCC documentantion is awful: A lot of time you have to guess extensions points names...Where I can find the full list of extensions points? I can not interpret documentation in http://www.webdetails.pt/ctools/charts/jsdoc/ .

    Regards,
    Roberto Tardío

  6. #6
    Join Date
    Mar 2012
    Posts
    645

    Default

    Hi Roberto,

    thanks for being sincere. However, a bit of salt wouldn't hurt.

    The CCC site contains a page for each chart type, where you can check every available option and extension point.

    For example, all of the Pie chart's extension points are listed here: http://www.webdetails.pt/ctools/ccc/...tension-points.
    This lists the available prefixes, ending with "_".
    Next, you have to pick an available property, from the list of the available properties, for the extension point's protovis mark type.

    Follow one of the extension points link.
    For example, the "label_" extension point takes you to.
    http://www.webdetails.pt/ctools/ccc/...nts.html#label

    Then click the link with the extension point's type name, LabelExtensionPoint. It will take you to:
    http://www.webdetails.pt/ctools/ccc/...sionPoint.html

    In this page you have all available label EP properties, like "font" and "text".

    The final extension point name is built by joining one of this property names with the EP prefix you originally followed, e.g.:
    "label_font"
    "label_text"

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.