Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Tag cloud?

  1. #1

    Default Tag cloud?

    Hi.

    I was wondering is there any ccc or protovis or something like that solution to make a tag cloud \ word cloud type of charts in Pentaho CE?

    Something very much like this:

  2. #2
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    There isn't a protovis Tag Clound out of the box, so you'd have to build your own (which might be a bit hard).

    Maybe look at D3 ? And look at the D3 Component Gallery available in the marketplace on how to make a d3 visualization available to CDE/CDF
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  3. #3

    Default

    Quote Originally Posted by pamval View Post
    There isn't a protovis Tag Clound out of the box, so you'd have to build your own (which might be a bit hard).

    Maybe look at D3 ? And look at the D3 Component Gallery available in the marketplace on how to make a d3 visualization available to CDE/CDF
    Okey, thanks for the answer tho'. I will look if there is any D3 solution for this and if I remember, come back here with answers.

    edit.
    I did find this from D3 library
    https://github.com/jasondavies/d3-cloud
    Last edited by nobomopo; 08-04-2014 at 07:03 AM.

  4. #4

    Default

    Umm.. I did found this from the web. But for some reason I can't use it on my d3component?
    What are the steps and setups that has to be done to show this on my dashboard?

    http://jsfiddle.net/adiioo7/RUTpJ/light/

    I have a div on html-file "wordcloud".

    Then I created D3 Component component from the components panel

    Put these settings:

    Name wordcloudchart
    Listeners []
    Parameters []
    Custom Chart Script var fill = d3.scale. (...)
    ...
    Datasource -
    Width 300
    Height 300
    HtmlObject wordcloud

    And on the custom chart script I put that script from the link. But nothing shows up :/

  5. #5

    Default

    Well this works simply on html\js https://github.com/iwek/jquery.wordcloud.js

    But how can I pass sql query result to javascript in pentaho?

  6. #6

    Default

    Any help..?

  7. #7
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    read this for help setting up the d3 component: http://pedroalves-bi.blogspot.pt/201...allery_17.html
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  8. #8
    Join Date
    Feb 2016
    Posts
    1

    Default

    Using a similar approach to this guy, you can get pretty close by modifying a query component. It doesn't do transparency, though. Just size.

    For the layout component, you need an html element with a known id.

    Your query component needs a couple of things:
    1. It needs a Result Var property of some sort.
    2. It needs a Post Execution script.

    Code:
    function(){
        var myData = result_fetch_db_connections;  // matches whatever you put in the Result Var property
        var myContainer = document.getElementById('html_db_connection_picker');  // matches the layout element's id
        var myParagraph = document.createElement('P');  // could just right directly to the layout element, i suppose, but this seems safer.
        myContainer.appendChild(myParagraph);
        for(var i = 0; i < myData.length; i++) {
            var myValue = document.createTextNode(myData[i][1] + ' - '); // name is in second column of sql result
            var mySpan = document.createElement('span');
            var mySize;
            if (myData[i][0] < 1) {  // log of zero would be an error
                mySize = 0;
            } else {
                mySize = Math.log(myData[i][0]); // frequency is in first column of sql result
            }
            mySize = mySize + 8 + 'px';  // modify however is necessary 
            mySpan.style.fontSize = mySize; 
            mySpan.appendChild(myValue)
            myContainer.lastChild.appendChild(mySpan);
            }
    }

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.