All Projects → nagix → Chartjs Plugin Rough

nagix / Chartjs Plugin Rough

Licence: mit
Chart.js plugin to create charts with a hand-drawn, sketchy, appearance

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Chartjs Plugin Rough

Tinyfaces Sketch Plugin
Fill selected layers in Sketch with free stock avatars
Stars: ✭ 221 (+274.58%)
Mutual labels:  plugin, sketch
Keys For Sketch
Advanced shortcut manager for Sketch app.
Stars: ✭ 281 (+376.27%)
Mutual labels:  plugin, sketch
Miaow
A set of plugins for Sketch include drawing links & marks, UI Kit & Color sync, font & text replacing.
Stars: ✭ 2,536 (+4198.31%)
Mutual labels:  plugin, sketch
Icondrop
Get access to 2 million+ design resources right inside Adobe Xd, Figma, Sketch, Microsoft Office, G Suite and many more.
Stars: ✭ 174 (+194.92%)
Mutual labels:  plugin, sketch
Sketch Sf Ui Font Fixer
A Sketch plugin that adjusts the character spacing on text layers using iOS 9's SF UI Text/SF UI Display fonts to what it would be when used in an iOS app.
Stars: ✭ 492 (+733.9%)
Mutual labels:  plugin, sketch
Sparkliner
Sparkliner — easy way to make sparkline graph [Sketch plugin]
Stars: ✭ 184 (+211.86%)
Mutual labels:  plugin, sketch
Sketch Connection Flow Arrows
Plugin for generating easy to use connection flow arrows in Sketch
Stars: ✭ 275 (+366.1%)
Mutual labels:  plugin, sketch
Logodrop
A Sketch Plugin to get brand logos right into Sketch App.
Stars: ✭ 140 (+137.29%)
Mutual labels:  plugin, sketch
Chartjs Plugin Zoom
Zoom and pan plugin for Chart.js
Stars: ✭ 404 (+584.75%)
Mutual labels:  plugin, chartjs
Chartjs Plugin Annotation
Annotation plugin for Chart.js
Stars: ✭ 389 (+559.32%)
Mutual labels:  plugin, chartjs
Sketch2ae
A Sketch plugin to export sketch file to Adobe After Effect
Stars: ✭ 170 (+188.14%)
Mutual labels:  plugin, sketch
Skpm
💎📦 A utility to build and publish Sketch plugins
Stars: ✭ 890 (+1408.47%)
Mutual labels:  plugin, sketch
Sketch Divine Proportions
Divine proportions toolkit for Sketch
Stars: ✭ 143 (+142.37%)
Mutual labels:  plugin, sketch
Chartjs Plugin Colorschemes
Predefined color schemes for Chart.js
Stars: ✭ 189 (+220.34%)
Mutual labels:  plugin, chartjs
Fake Chinese Name For Sketch
生成随机中文人名的 Sketch 插件
Stars: ✭ 141 (+138.98%)
Mutual labels:  plugin, sketch
Merge Duplicate Symbols
Sketch plugin to merge symbols and layer&text styles.
Stars: ✭ 272 (+361.02%)
Mutual labels:  plugin, sketch
Sketch Dockpreview
A Sketch plugin that lets you preview your current artboard in the Dock.
Stars: ✭ 90 (+52.54%)
Mutual labels:  plugin, sketch
Chartjs Plugin Dragdata
Draggable data points plugin for Chart.js
Stars: ✭ 116 (+96.61%)
Mutual labels:  plugin, chartjs
Chartjs Plugin Streaming
Chart.js plugin for live streaming data
Stars: ✭ 310 (+425.42%)
Mutual labels:  plugin, chartjs
Chartjs Plugin Datalabels
Chart.js plugin to display labels on data elements
Stars: ✭ 545 (+823.73%)
Mutual labels:  plugin, chartjs

chartjs-plugin-rough

npm Bower Travis Code Climate Awesome

Chart.js plugin to create charts with a hand-drawn, sketchy, appearance

Version 0.2 requires Chart.js 2.7.0 or later, and Rough.js 2.0.1 or later.

Installation

You can download the latest version of chartjs-plugin-rough from the GitHub releases.

To install via npm:

npm install chartjs-plugin-rough --save

To install via bower:

bower install chartjs-plugin-rough --save

To use CDN:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chartjs-plugin-rough.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/chartjs-plugin-rough.min.js"></script>

Usage

chartjs-plugin-rough can be used with ES6 modules, plain JavaScript and module loaders.

chartjs-plugin-rough requires Chart.js and Rough.js. Include Chart.js, Rough.js and chartjs-plugin-rough.js to your page to render sketchy charts. Note that chartjs-plugin-rough must be loaded after the Chart.js and Rough.js libraries. Once imported, the plugin is available under the global property ChartRough.

Then, you need to register the plugin to enable it for all charts in the page.

Chart.plugins.register(ChartRough);

Or, you can enable the plugin only for specific charts.

var chart = new Chart(ctx, {
    plugins: [ChartRough],
    options: {
        // ...
    }
});

Usage in ES6 as module

Import the module as ChartRough, and register it in the same way as described above.

import ChartRough from 'chartjs-plugin-rough';

Tutorial and Samples

You can find a tutorial and samples at nagix.github.io/chartjs-plugin-rough.

Configuration

The plugin options can be changed at 3 different levels and are evaluated with the following priority:

  • per dataset: dataset.rough.*
  • per chart: options.plugins.rough.*
  • globally: Chart.defaults.global.plugins.rough.*

All available options are listed below. This example shows how each option affects the appearance of a chart.

Name Type Default Description
roughness number 1 Numerical value indicating how rough the drawing is. See Rough.js.
bowing number 1 Numerical value indicating how curvy the lines are when drawing a sketch. See Rough.js.
fillStyle string 'hachure' String value representing the fill style. See Rough.js.
fillWeight number 0.5 Numeric value representing the width of the hachure lines. See Rough.js.
hachureAngle number -41 Numerical value (in degrees) that defines the angle of the hachure lines. See Rough.js.
hachureGap number 4 Numerical value that defines the average gap, in pixels, between two hachure lines. See Rough.js.
curveStepCount number 9 When drawing circles and arcs, the plugin approximates curveStepCount number of points to estimate the shape. See Rough.js.
simplification number 0 When drawing lines, simplification can be set to simplify the shape by the specified factor. The value can be between 0 and 1. See Rough.js.

For example:

{
    type: 'bar',
    data: {
        labels: ['January', 'February', 'March', 'April', 'May', 'June'],
        datasets: [{
            data: [45, 20, 64, 32, 76, 51],
            backgroundColor: 'rgb(255, 99, 132)',
            borderColor: 'rgb(255, 99, 132)',
            borderWidth: 3,
            rough: {
                roughness: 1,
                bowing: 1,
                fillStyle: 'hachure',
                fillWeight: 0.5,
                hachureAngle: -41,
                hachureGap: 4,
                curveStepCount: 9,
                simplification: 0
            }
        }]
    }
}

Note that the following line style options are ignored.

  • borderCapStyle
  • borderDash
  • borderDashOffset
  • borderJoinStyle
  • borderAlign

Building

You first need to install node dependencies (requires Node.js):

npm install

The following commands will then be available from the repository root:

gulp build            # build dist files
gulp build --watch    # build and watch for changes
gulp lint             # perform code linting
gulp package          # create an archive with dist files and samples

License

chartjs-plugin-rough is available under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].