mkschart v72.0.0
Getting Started with Create React App
This project was bootstrapped with Create React App.
Available Scripts
In the project directory, you can run:
yarn start
Runs the app in the development mode.\ Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.\ You may also see any lint errors in the console.
yarn build
Rollup bundle is created at dist/mkschart.js
Dependency
Need to import script in which react project we are going to import the mkschart
Package installation for react
yarn add mkschart
Import methods for react
import MKSChart from 'mkschart'
function App() { const data = { ticker: ticker, apiKey: apiKey, baseURL: baseURL, };
return (
<div style={{ width: '100%', height: '95vh' }}> //height and width must be define
<MKSChart data={data} />
</div>
); }
export default App;
Import method using mkschartHTML.js bundle
import { useEffect } from 'react'; import '../mkschartHTML.js'; //path from where the bundle is imported
const MKSChart = ({ data }) => {
useEffect(() => { if (window.createMksChart) { window.createMksChart(data); } else { console.error('createMksChart function not found in the global scope.'); } }, data)
return (
<div style={{ width: '100%', height: '100%', position: 'relative' }}>
<div id='chart-container' style={{ height: '100%' }} />
</div>
) };
export default MKSChart;
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago