npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

docxtemplater-chart-module

v2.0.1

Published

Chart Module for docxtemplater v1.0

Downloads

318

Readme

Chart module for docxtemplater.

Build Status Download count Current tag Issues closed

Installation:

You will need docxtemplater v1: npm install docxtemplater

install this modile: npm install docxtemplater-chart-module

Usage

Your docx should contain the text: {$chart}

var fs = require('fs');
var ChartModule = require(‘docxtemplater-chart-module’);
var chartModule = new ChartModule();

var docx = new DocxGen()
  .attachModule(chartModule)
  .load(content)
  .setData({
    chart: {
      lines: [
        {
          name: 'line 1',
          data: [
            {
              x: 'day 1',
              y: '4.3'
            },
            {
              x: 'day 2',
              y: '2.5'
            },
            {
              x: 'day 3',
              y: '3.5'
            }
          ]
        },
        {
          name: 'line 2',
          data: [
            {
              x: 'day 1',
              y: '2.4'
            },
            {
              x: 'day 2',
              y: '4.4'
            },
            {
              x: 'day 3',
              y: '1.8'
            }
          ]
        }
      ]
    }
  })
  .render();

var buffer = docx
  .getZip()
  .generate({type:"nodebuffer"});

fs.writeFile("test.docx", buffer);

Options

Defaults

defaultOptions = {
  width: 5486400 / 9525,
  height: 3200400 / 9525,
  grid: true,
  border: true,
  title: false,
  legend: {
    position: 'r', // 'l', 'r', 'b', 't'
  },
  axis: {
    x: {
      orientation: 'minMax', // 'maxMin'
      min: undefined, // number
      max: undefined,
      type: undefined, // 'date'
      date: {
        format: 'unix',
        code: 'mm/yy', // "m/yy;@"
        unit: 'months', // "days"
        step: '1'
      }
    },
    y: {
      orientation: 'minMax',
      mix: undefined,
      max: undefined
    }
  }
}

Building

You can build the coffee into js by running gulp (this will watch the directory for changes)

Testing

You can test that everything works fine using the command mocha. This will also create 3 docx files under the root directory that you can open to check if the docx are correct

Changelog

1.0.0

  • Chart creation in loop contributed by colmben

0.3.0

  • Border option, enabled by default

0.2.1

  • bug fixes

0.2.0

  • title option, disabled by default

0.1.0

  • steps for date type

0.0.9

  • type 'date' support
  • time format in 'unix' or '1900' (amount of days since 1900)
  • units for steps on axis
  • formatCode for like i.e: 'd/m/yy' or 'm/yyyy'

0.0.8

  • grid option

0.0.7

  • lines on axis are still stacking, sadly

0.0.6

  • x and y axises flipped in options, now correct

0.0.5

  • min and max axis values options added
  • options are nested now for easier readability