Created
January 6, 2023 06:04
-
-
Save JenniferFuBook/fd75c5f48d024463ff1ccce94d53c26b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Plot from 'react-plotly.js'; | |
| const layoutObj = { | |
| title: 'Scatter Chart', | |
| width: 800, | |
| height: 600, | |
| }; | |
| const dataArray = [ | |
| { | |
| type: 'scatter', | |
| y: [1, 2, 1, 4, 3, 6], | |
| mode: 'lines+markers', | |
| }, | |
| { | |
| type: 'scatter', | |
| y: [2, 7, 0, 4, 6, 2], | |
| mode: 'markers+lines', | |
| marker: { | |
| color: 'green', | |
| size: 12, | |
| }, | |
| line: { | |
| color: 'red', | |
| width: 3, | |
| }, | |
| }, | |
| ]; | |
| function App() { | |
| return <Plot layout={layoutObj} data={dataArray} />; | |
| } | |
| export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment