-
Notifications
You must be signed in to change notification settings - Fork 4
Chart #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chart #11
Changes from all commits
0f01262
94ee35b
c56247d
c6b5ead
66f8d49
bbdf0d0
a863a24
89b33f5
33c2a7d
42b1a0a
d03bdee
7b70808
d48bd2e
ad57cad
b4178cd
32f8ead
d43c946
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| A,B,C | ||
| 1,2,20 | ||
| 2,3,10 | ||
| 3,3.2,30 | ||
| 4,5,60 | ||
| 5,2,70 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,28 @@ | ||
| import React from 'react' | ||
| import DataTable from './DataTable' | ||
|
|
||
| export default function DataTables({datacomp, setCompIndex, setSidePlane}) { | ||
|
|
||
| export default function DataTables({datacomp, setCompIndex, setSidePlane,setDataComp}) { | ||
| const remover = (keys) => { | ||
| setDataComp(datacomp.filter((el) => el.keys !==keys)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same thing here instead of filter we can delete the element totally.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i did filter so the component can be deleted individually
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand but this not removing the element from the component state. can you try creating multiple charts and see if the deleting will work
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it does |
||
| } | ||
| return ( | ||
| <div> | ||
| {datacomp.map((val,index) => { | ||
| return <DataTable | ||
| return( | ||
| <> | ||
| {/* <button onClick={()=> remover(val.keys)} className="bg-red-700 text-white rounded-sm p-2">Delete</button> */} | ||
| <DataTable | ||
| key={index} | ||
| columns={val.columns} | ||
| values={val.values} | ||
| setCompIndex={setCompIndex} | ||
| index={index} | ||
| setSidePlane={setSidePlane} | ||
| remover={remover} | ||
| keys={val.keys} | ||
| /> | ||
| </> | ||
| ) | ||
| })} | ||
| </div> | ||
| ) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of
filterusesplice()to delete the chart component.