Git Product home page Git Product logo

react-ring-chart's Introduction

react-ring-chart

a ring-chart based on svg and react

Documentation

Params


|Key                   | Type     | Default            | Description        |
| -------------------- | -------  | ---- ------------- |                    |
|width                 | number   | 300                |                    |
|gap                   | number   | 10                 |                    |
|titleFontSize         | string   | 14                 |                    |
|percentageFontSize    | string   | 24                 |                    |
|innerBgDefault        | string   | #cbcbcb            |                    |
|outerBgDefault        | string   | #e8e8e8            |                    |
|innerBgActive         | string   | #99b8f9            |                    |
|outerBgActive         | string   | #d2e0fc            |                    |
|title                 | string   | total              |                    |
|titleFill             | string   | #aaa               |                    |
|percentageFill        | string   | #24bcb4            |                    |
|percentage            | number   | 0                  |                    |
|top                   | object 
|                           active:bool,
|                           imgUrl:string,
|                           text:string,
|                           fontSize:string,
|                           textFill:string                                                  
|bottom                | object (same as top)
|left                  | object (same as top)
|right                 | object (same as top)

Usage

Step 1 - install

	npm install react-ring-chart --save

Step 2 - import and use in project

import RingChart from "react-ring-chart";

     <RingChart config = {config}/>
   

Demo

    mkdir test
    cd test
    npm i react-ring-chart
    cd react-ring-chart
    npm i
    npm run start

Note

make sure that '@babel/plugin-proposal-class-properties' and 'babel-preset-react-app' are in your devDependencies.
if you use 'creat-react-app',do the follow steps below:
    1. {
                    test: /\.(js|mjs)$/,
                    exclude: /@babel(?:\/|\\{1,2})runtime/,
                    loader: require.resolve('babel-loader'),
                    options: {
                      babelrc: false,
                      configFile: false,
                      compact: false,
                      presets: [
                        [
                          require.resolve('babel-preset-react-app/dependencies'),
                          { helpers: true },
                        ],
                    +     [ "react-app"]
                      ],
                    +  plugins:[ ['@babel/plugin-proposal-class-properties',{'loose':true}]],
                      cacheDirectory: true,
                      // See #6846 for context on why cacheCompression is disabled
                      cacheCompression: false,
                      
                      // Babel sourcemaps are needed for debugging into node_modules
                      // code.  Without the options below, debuggers like VSCode
                      // show incorrect code and set breakpoints on the wrong lines.
                      sourceMaps: shouldUseSourceMap,
                      inputSourceMap: shouldUseSourceMap,
         },

react-ring-chart's People

Contributors

regon-cao avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.