+ Reply to Thread
Results 1 to 12 of 12

JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

  1. #1
    Registered User
    Join Date
    10-26-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    50

    Question JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

    Code below submitted by user Kyle123, makes for a seamless word cloud integration within excel. I am hoping to make a few tweaks. Specifically I'd like to find a way to change the colors of my 5 top occurring words (i.e. make the biggest boldest tags appear red as they represent a high occurrence of injuries for my specific use. I'd also like to be able to run off of whatever portion of a column I currently have selected, rather than statically referencing say A1:A50.

    The second goal should be easy within the vba, but I'm guessing the first change would have to reside within http://visapi-gadgets.googlecode.com...rdcloud/wc.css, http://visapi-gadgets.googlecode.com...ordcloud/wc.js, or text/javascript"" src=""http://www.google.com/jsapi""></script>. My apologies, I'm not very familiar with google visualizations or jquery. And thank you Kyle123 for what seems to be one of the best inclusions of a word cloud generating tool within excel.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

    This will allow you to set the colours, I have removed the external style sheet so it is easy to change the colours/font sizes.

    To change the colours, you need to adjust the # numbers in red below, they are listed in ascending order do the last is the most frequently occurring word and the first is the least occurring

    Please Login or Register  to view this content.
    For the other part, you just need:

    Please Login or Register  to view this content.
    Last edited by Kyle123; 12-19-2011 at 01:12 PM.

  3. #3
    Registered User
    Join Date
    10-26-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

    OK that should work for changing the colors then. Another question I had forgot about. Although I couldn't get your advised change to work for running off the selection.

    I moved the WebBrowser control to another sheet called "Cloud." I really wish I could tweak the code so that 1) I could run it any time off of a selected single column chunk of data i.e. highlight and say run and it will generate the new cloud based on the currently selected data. 2) that it displays this cloud on a different sheet than the worksheet containing all the data (I have multiple columns of data and it would be nicer to have the cloud appear on a separate worksheet), however the "With Cloud.WebBrowser1" I believe is fouling it up.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

    You need:

    Please Login or Register  to view this content.
    To run it from a selection

    Select the data, click run macro: MakeVis

    the code for the macro would be:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-26-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

    Thank you Kyle,

    Changing it to With Sheets("Cloud").WebBrowser1 seemed to take care of displaying it on a separate worksheet, also made my test code Public. To add any additional stop words I would somehow have to get into the referenced sites I presume?

  6. #6
    Registered User
    Join Date
    10-26-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

    Kyle and others,

    I have a similar problem I'm experiencing with another piece of tag cloud generating code. My plan is to use Kyle's or something like it for the customer when they have internet available and another one that will work (albeit not as beautifully) when internet isn't available and display both on a sheet called Cloud in sort of a dashboard type presentation. One issue I'm having with this code is I've been unable to successfully display the cloud on the cloud worksheet (sounding similar?). I had a cell on the cloud worksheet that had been formatted for the cloud to appear nicely (merged multiple cells together for one bigger one, with wrapped text, and a thick border). I have a little message which asks where you'd like to place the tag cloud since I was fiddling around a lot to see what it would and would not accept. Low and behold it will only accept a cell on the FreqTable worksheet (which is created to place the pivot table on). Is there any way so that I could get this to display on the same "Cloud" worksheet which now has the tag cloud from Kyle's code?

    Please Login or Register  to view this content.

  7. #7
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

    To add any additional stop words I would somehow have to get into the referenced sites I presume
    Yes although there is no reason that you couldn't edit the external JS file and store locally, although it would be a bit of a pain to distribute

  8. #8
    Registered User
    Join Date
    10-26-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

    Yea the distribution part is making this project a little harder than it needs to be...any idea whats causing my other tag cloud generating code to bug out when I try and place the generated cloud on another sheet? With Sheets("Cloud").WebBrowser1 allowed the generated cloud from your code to appear on the cloud worksheet.

    But can't seem to figure out any way for my other "offline" cloud generator (code two posts above) to display anywhere except on the sheet that is active with frequency counts which I really hope to only use as a work sheet (do calculations and the such but not really ever display to the user).

  9. #9
    Registered User
    Join Date
    10-26-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

    I've been working with the code Kyle provided and it's been working nicely. Been able to add stop words and change the colors based on frequencies...still wish I understood how the javascript worked in more detail so I could figure out this next seemingly very simple stupid question:

    How can I add commas to separate the different words/strings. In my case the strings are type descriptions of injuries so separating the descriptions so the user can quickly visualize the injury types they need to focus on is important. Sorry that this may seem like a javascript question but it is still pairing with excel/vba. I believe this change would lie within this bit of code rather than the vba side...

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    10-26-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

    Hey in case anyone else could find this useful. Still working on some other details of the project and have a thread open here http://www.mrexcel.com/forum/showthr...=1#post3012941 describing the main issue I'm trying to figure out. Hope this can help someone. Thanks again for your help Kyle.

    Please Login or Register  to view this content.
    Last edited by VTHokie11; 01-24-2012 at 02:55 PM. Reason: Had to take out some commenting w/in code.

  11. #11
    Registered User
    Join Date
    10-26-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

    Hey in case anyone else could find this useful. Still working on some other details of the project and have a thread open here http://www.mrexcel.com/forum/showthr...=1#post3012941 describing the main issue I'm trying to figure out. Hope this can help someone. Thanks again for your help Kyle.

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    10-26-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: JQuery Google Visualizations Intro / Tag (Word) Cloud Generator

    Although I was just thinking the only reason I'm trying to figure out the problem cited the other thread is to get the frequency counts of all the words, which I know could also be accessed through the jscript and html push...I know this is a vba forum but anyone have any advice for how to edit the above jscript code to display the actual frequency counts? And perhaps sum and display the top five frequency counts?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1