Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: How to make the tipvalue of all parts of stack show up together in ccc-Barchart?

  1. #1
    Join Date
    Dec 2017
    Posts
    1

    Thumbs up How to make the tipvalue of all parts of stack show up together in ccc-Barchart?

    Hi,there
    It's been a long time since I've been puzzled by the tooltip problem of stack graphs in CCC barchart.
    I want to make the tipvalue of all parts of stack show up together in ccc-Barchart.
    Please refer to the attachment.


    For example,
    the default tooltip is undivided, like:
    part one

    date Oct01
    channel one
    cost 100



    part two

    date Oct01
    channel two
    cost 200



    part three

    date Oct01
    channel three
    cost 300



    But I need the effect just like:

    date Oct01
    channel-one-cost 100
    channel-two-cost 200
    channel-three-cost 300
    】.




    I just need to know how to get the value of all the parts of the stack,no matter which part the mouse hovering.


    The function below just returning the value of the part of the mouse which hovering


    function(scene){
    var channel = scene.atoms.series.label;
    //console.log(channel);
    var date = scene.atoms.category.value;
    var costs = scene.vars.value.value;


    }


    I've been searching on pentaho forums for a long time, but there's no result.
    Thanks so much!
    Attached Images Attached Images  

  2. #2

    Default

    This is how I solved this issue in my case: I don't know if there is a more simpler way.

    1- use a Query Component with:
    Datasource: SELECT date, channel, cost FROM ...
    Result Var: varDataArray
    HtmlObject: (empty)

    2- Stacked bar chart with:
    Datasource: (the DS needed to generate the stacked bar chart)
    priority: a value greater (lower priority) than the priority of Query Component
    tooltipFormat:
    function(scene)
    { var data,dy,dt,ch,co;
    dy=scene.vars.category.value; // the day of interest
    data=varDataArray;
    // now the data you need is in the array
    // you can build a <div> tag as you like, e.g in mydiv variable
    for (ix=0; ix<data.length; ix++)
    { dt=data[ix][0];
    ch=data[ix][1];
    co=data[ix][2];
    ....
    }
    return mydiv;
    }

    In this way the data used to feed the tooltip is decoupled from the data used to feed the bar chart
    Hope this may help
    Luciano

Tags for this Thread

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.