Socket
Socket
Sign inDemoInstall

@canvasjs/react-stockcharts

Package Overview
Dependencies
4
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @canvasjs/react-stockcharts

CanvasJS React StockCharts - Official


Version published
Maintainers
1
Install size
10.9 kB
Created

Readme

Source
CanvasJS

CanvasJS React StockCharts - Official

CanvasJS React StockChart Component for creating advanced interactive Financial Charts for your react applications. Library supports a wide range of chart types including line, area, candlestick, ohlc, etc.


CanvasJS React StockCharts

Installing CanvasJS React StockChart

Install CanvasJS React StockCharts to your application from npm.

Install React StockChart via NPM
npm install @canvasjs/react-stockcharts

See npm documentation to know more about npm usage.

Import React StockChart Component

Import the React StockChart module into your React application.

import CanvasJSReact from '@canvasjs/react-stockcharts';
//var CanvasJSReact = require('@canvasjs/react-stockcharts');

var CanvasJSStockChart = CanvasJSReact.CanvasJSStockChart;
Set the stockchart-options & create chart

Set the stockchart-options & use 'CanvasJSStockChart' selector to create stockchart.

class App extends Component {
  render() {
    const options = {
      title: {
        text: "CanvasJS React StockChart"
      },
      charts: [{
        data: [{
          type: "line",
          dataPoints: [
            { x: new Date("2018-01-01"), y: 71 },
            { x: new Date("2018-02-01"), y: 55 },
            { x: new Date("2018-03-01"), y: 50 },
            { x: new Date("2018-04-01"), y: 65 },
            { x: new Date("2018-05-01"), y: 95 },
            { x: new Date("2018-06-01"), y: 68 },
            { x: new Date("2018-07-01"), y: 28 },
            { x: new Date("2018-08-01"), y: 34 },
            { x: new Date("2018-09-01"), y: 14 },
            { x: new Date("2018-10-01"), y: 71 },
            { x: new Date("2018-11-01"), y: 55 },
            { x: new Date("2018-12-01"), y: 50 },
            { x: new Date("2019-01-01"), y: 34 },
            { x: new Date("2019-02-01"), y: 50 },
            { x: new Date("2019-03-01"), y: 50 },
            { x: new Date("2019-04-01"), y: 95 },
            { x: new Date("2019-05-01"), y: 68 },
            { x: new Date("2019-06-01"), y: 28 },
            { x: new Date("2019-07-01"), y: 34 },
            { x: new Date("2019-08-01"), y: 65 },
            { x: new Date("2019-09-01"), y: 55 },
            { x: new Date("2019-10-01"), y: 71 },
            { x: new Date("2019-11-01"), y: 55 },
            { x: new Date("2019-12-01"), y: 50 }
          ]
        }]
      }],
      navigator: {
        slider: {
          minimum: new Date("2018-07-01"),
          maximum: new Date("2019-06-30")
        }
      }
    };

    return (
      <div>
        <CanvasJSStockChart options = { options }
          /* onRef = {ref => this.stockchart = ref} */
        />
      </div>
    );
  }
}

React StockChart
Interactive React StockCharts

React Interactive StockCharts


Keywords

FAQs

Last updated on 29 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc