Adding charts to your site

Adding charts to your site has been made very easy, using shortcodes. If you don’t know what shortcodes are or how they work, please have a look at this page: How to use Shortcodes.

Now the NaNoWriMo Stats plugin has a shortcode to generate beautiful charts:

[nanostats]

Just add this shortcode to your post, page or widget and the plugin will generate a chart, like this:

But there is more…

Yes, variables! There is a set of variables available for the shortcode that allows you to override the default settings you set at the Settings Page.

  • width: this variable changes the width of the chart. In pixels please.
  • height: this variable changes the… well, you get the idea. In pixels please.
  • username: override the default username setting with this variable. It allows you to show charts for another user as well.
  • wccolor: choose a color for the wordcount bars. Don’t forget the hash-tag # that is needed for web colors.
  • goalcolor: does the same thing, but now for the goal line. Again: don’t forget the hash-tag!
  • dailycolor: does the same thing, but now for the daily wordcount bars. Don’t forget the hash-tag!
  • showtotals: set to false if you don’t want to see the total wordcount bars. Default is true.
  • showdaily: set to false if you don’t want to see the daily wordcount bars. Default is true.
  • showgoals: set to false if you don’t want to see the goal line. Default is true.
  • showtitle: set to false if you don’t want a title in this chart. Default is true, so you don’t need to include this variable if you do want a title.

Please note that none of these variables is necessary! If you do not include one, the default value will be used.

Some examples

[nanostats width=400 height=300 wccolor=#ff0000 goalcolor=#00ff00]
[nanostats wccolor=#00aaff showtitle=false]

Leave a Reply

Your email address will not be published. Required fields are marked *