Let's say your study asked respondents to provide text answers to an open ended question:
The answers might be too long to read in one line and too many to show in one bar chart. WordClouds can be a simple
and whimsical way to quickly convey the gist of the answers.
## Create a WordCloud
To turn this into a word cloud press the circle edit icon to bring up the context menu and select "More properties...".
Under "Chart type" select "Word cloud". This will create a simple cloud showing all verbatim answers:
By default. this shows the frequency of each answer, with font size equal to the percentage frequency.
The fonts are small because each answer is unique and represents is a tiny percentage of the sample.
Typically though this is not so interesting as each response is unique.
## Split phrases into words
To show frequencies of individual words rather than complete responses, select "Edit properties..." again and under "Split" type either
* " " (i.e. just a space, without the quotes) or
* "word" (i.e. just the word 'word' without the quotes)
The first will split the sentences at each space. The second will be a little smarter and split at certain punctuation as well.
This will now split strings at each space into shorter strings, and thus show frequencies of each word:
## Customize the chart
Initially the font size mau still be too small. This is because Protobi calculates the font size by multipling the the percentage frequency
by the value of `maxFontSize` under `chartOptions. To adjust this, we can edit the detailed options.
Select "Edit JSON..." from the context menu. Under `chartOptions` are the available options. E.g. set `scaleFontToMaxValue: "true"` and the fonts will be scaled
such that the largest item is equal to `maxFontSize`.
## Available options
WordClouds are powered by the awesome engine by [Timothy Chien](https://twitter.com/timdream?lang=en).
The `chartOptions` block is passed straight to the rendering engine, allowing you to set these options:
* `minFontSize`: `5` minimum font size to draw on the canvas.
* `maxFontSize`: `60` maximum font size, in pixels or points .
* `scaleToMaxFontSize`: `true` whether to scale
* `limit` : `60` maximum number of values to draw
* `fontFamily`: font to use.
* `fontWeight`: `"normal"` font weight to use, e.g. `normal`, `bold` or `600`
* `color`: color of the text, can be any CSS color
* `weightFactor`: number to multiply `size` of each word
* `backgroundColor`: color of the background.
* `drawOutOfBound`: `true` allows words bigger than the size of the canvas to be drawn.
* `shape`: `"ellipse"` The shape of the "cloud" to draw,
- `"circle"` (default),
- `"cardioid"`,
- `"diamond"`,
- `"square"`,
- `"triangle"`,and
- `"star"`.
* `ellipticity`: [ degree of "flatness" of the word cloud shape.
* `shuffle`: `true` (default) randomizes points
* `rotateRatio`: Probability for word to rotate. 1=always, 0=never.