1.0.4 • Published 7 years ago

minimalistic-charts v1.0.4

Weekly downloads
21
License
-
Repository
github
Last release
7 years ago

minimalisticcharts (WIP)

SIMPLE MINIMALISTIC LOOKING CHARTS

Demo

Live demo: SKarajic.github.io/minimalistic-charts

Installation

The easiest way to use minimalistic-charts is to install it from NPM and include it in your own React build process (using Browserify, Webpack, etc).

import { PieChart } from 'minimalistic-charts';

npm install minimalistic-charts --save

Usage

PIECHART

Description

Creates a basic piechart

Usage

import { PieChart } from 'minimalistic-charts';

<PieChart size={px} background={color} data={array}/>

Parameters

  • Required
  • size: the size of the piechart in px.
  • data: a Json array containing Json objects with the following parameters.
    • Required
    • percentage: number between 0 and 1 representing a percentage.

    • Optional
    • color: color of a piechart section (can be a name, hexvalue or rgb(a) value).

  • Optional
  • background: color of the piechart (can be a name, hexvalue or rgb(a) value).

HOLLOWPIECHART

Description

Creates a piechart that is hollow

Usage

import { HollowPieChart } from 'minimalistic-charts'; 

<HollowPieChart size={px} strokeWidth={px} background={color} data={array}/>

Parameters

  • Required
  • size: the size of the piechart in px.
  • data: a Json array containing Json objects with the following parameters.
    • Required
    • percentage: number between 0 and 1 representing a percentage.

    • Optional
    • color: color of a piechart section (can be a name, hexvalue or rgb(a) value).

  • Optional
  • background: color of the piechart (can be a name, hexvalue or rgb(a) value).
  • strokeWidth: the width of the stroke in px.
  • text: a Json object containing the following parameters.
    • Required
    • content: a string, number or element that centers in the chart.

    • Optional
    • color: color of the text (can be a name, hexvalue or rgb(a) value)
    • fontWeight: size of the font.
    • fontFamily: fontType of the text.

  • Note; other CSS values can be parsed in the text parameter as well

Development (src, lib and the build process)

NOTE: The source code for the component is in src. A transpiled CommonJS version (generated with Babel) is available in lib for use with node.js, browserify and webpack. A UMD bundle is also built to dist, which can be included without the need for any build system.

To build, watch and serve the examples (which will also watch the component source), run npm start. If you just want to watch changes to src and rebuild lib, run npm run watch (this is useful if you are working with npm link).

License

MIT License

Copyright (c) 2017 Sandi Karajic

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

  • The creator of the Software is not in any way accountable for the actions the person that uses the Software perform or the way the person uses the Software

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago