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 🙏

© 2024 – Pkg Stats / Ryan Hefner

fundcharts

v0.9.11

Published

lightweight canvas data visualization library. 1.x: line/bar/pie/radar/scatter/kline chart.

Downloads

4

Readme

FundCharts

web/weapp/nodejs canvas lite charts library.

Version

0.9.11

update info:

  • 2022.02.05: fix linear bug; fix option clone bug; add instance destory() function;
  • 2021.09.25: support TypeScript; ToolTips support React/Vue component use;
  • 2021.06.20: fix weapp register bug;
  • 2021.06.08: fix number bug; code optimization;
  • 2020.09.08: add ToolTipsJS;
  • 2020.02.28: fix pie chart bug; add stack display bars;
  • 2019.12.20: add React/Vue component; Pie/Radar origin optimize;
  • 2019.10.28: default transparent background('#fff' -> 'rgba(0,0,0,0)'); optimize line chart hover handler(onFinish, critical scene); scatter add border width control(borderRate);
  • 2019.09.20: add charts comboine function(line and kline, bar and line).grid(line/bar/scatter/kline): add x/y axis line display control(grid.showGrid), add x/y grid number control(xTickLength/yTickLength), hover callback function add touchEvent's y. add animation duration control(duration). pie: add start angle control(startAngle). fixed bugs;
  • 2019.08.23: optimize the line/pie/radar/bar's data update transition animation; set curve line(line, options.curveLine); set hollow display(kline, options.upHollow);
  • 2019.07.18: add bar/kline/pie/radar hover event; fixed bugs
  • 2019.06.20: add weapp animation; add axis handle functions(handleTextX/handleTextY)

Install

npm install --save fundcharts

Usage

1.set container

<!-- way 1 -->
<div id="chart" style="height: 2rem;"></div>

<!-- way 2(0.9.1+) -->
<canvas id="chart" width="375" height="200"></canvas>

2.import package

// i need line chart
import {line} from 'fundcharts'

or

import line from 'fundcharts/LineChart'

3.set config

// for example: line chart
let testline = new line({
	id: 'testline',
	xaxis: ['07-11', '08-11', '09-11', '09-22', '10-11', '11-11', '12-11'],
    datas: [
		[1, 2, 3, 4, 3.5, 3, 4]	
	]
});

4.draw chart

// for example: line chart
testline.init();

React/Vue Usage

React(v16.7+, hook) example

import React, {Component} from 'react';
import {Line} from 'fundcharts/react'

export default class LineShow extends Component {
    state = {
        index: '--',	// show hover index
        options: {		// chart options
            xaxis: ['1-11', '2-11', '3-11', '4-11', '5-11'],
            datas: [
                [1, 2, 3, 4, 5],
                [5, 3, 4, 2, 4]
            ]
        }
    };

    componentDidMount () {
        setTimeout(() => {
            this.setState({
                options: {
                    ...this.state.options,
                    datas: [
                        [3, 5, 6, 4, 2],
                        [3, 4, 3, 3, 5]
                    ]
                }
            })
        }, 5000);
    }

    setIndex (index) {
        this.setState({
            index
        })
    }

    render() {
        let {
            options,
            index,
        } = this.state;
        return (
            <div className="m-app">
                <p>{index}</p>
                <Line
                    options={options}
                    hover={this.setIndex.bind(this)}
                />
			</div>
        );
    }
}

Vue

<template>
    <section>
        <p class='f-tc'>{{index}}</p>
        <v-line
            prefix="aaa"
            :options="options"
        />
    </section>
</template>
<script>
import {Line} from 'fundcharts/vue';

export default {
    name: "lineshow",
    data () {
            return {
                options: {		// chart options
                    datas: [
                        [1, 2, 3, 4, 5],
                        [4, 2, 5, 5, 1]
                    ],
                    xaxis: ['1-11', '2-11', '3-11', '4-11', '5-11'],
                    
                    hover: this.handleHover
                },
                index: '--',	// show hover index
            }
    },
    components: {
            'v-line': Line,
    },
    methods: {
            handleHover (index) {
                console.log(index)
                this.show = index;
            }
    },
    mounted() {
            setTimeout(() => {
                this.options = {
                    ...this.options,
                        datas: [
                        [6, 3, 5, 3, 2],
                        [4, 5, 6, 4, 3]
                    ]
                }
            }, 5000);
    }
}
</script>

Configuration

document>>

demo

github FundCharts-demos

Author

Micheal Wayne

Update time

2022.02.05