GithubHelp home page GithubHelp logo

hhy5277 / qcharts-react Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qcharts/qcharts-react

0.0 1.0 0.0 2.49 MB

qcharts-React 是一个基于 spritejs , QCharts 封装的图表库,可以让用户以组件的形式组合出各种图表

License: MIT License

JavaScript 40.42% Vue 39.66% HTML 5.59% CSS 14.33%

qcharts-react's Introduction

qcharts-react

基于 QCharts 封装的 React 图表组件库。使用上基本与 QCharts 一致。 → 详细文档

安装

npm

npm i spritejs @qcharts/core qcharts-react

CDN

在 HTML 文件依次引入 spritejs@qcharts/coreqcharts-react

<script src="https://unpkg.com/spritejs@3/dist/spritejs.min.js"></script>
<script src="https://unpkg.com/@qcharts/core@1/lib/index.js"></script>
<script src="https://unpkg.com/qcharts-react/lib/index.js"></script>

绘制

import React from 'react'
import ReactDOM from 'react-dom'
import { Chart, Bar, Axis } from 'qcharts-react'

function App() {
  const data = [
    { value: 6100, label: 'TOP1' },
    { value: 5200, label: 'TOP2' },
    { value: 4400, label: 'TOP3' },
    { value: 3700, label: 'TOP4' },
    { value: 2800, label: 'TOP5' },
    { value: 2000, label: 'TOP6' },
    { value: 1300, label: 'TOP7' },
    { value: 400, label: 'TOP8' }
  ]
  const dataFields = {
    row: '*',
    value: 'value',
    text: 'label'
  }

  return (
    <QChart data={data} dataFields={dataFields} forceFit={true}>
      <Bar />
      <Axis />
      <Axis orient={'left'} />
    </QChart>
  )
}

ReactDOM.render(<App />, document.querySelector('#app'))

qcharts-react's People

Contributors

yaotaiyang avatar

Watchers

 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.