Comments (4)
You should be able to use the sorters
prop to specify the order you want to use for the Tamanho
attribute. You can see this in action in the demo here: https://github.com/plotly/react-pivottable/blob/master/examples/App.jsx#L44
from react-pivottable.
Yes, I saw this function but I tried with the following code
My Tips is this
["ordemProducao", "tamanho", "cor", "quantidade", "ordenacaoTamanho"], [225185,"G","000001",30,95], [225185,"M","000001",20,90], [225185,"GG","000001",40,100], [225185,"P","000001",60,85], [225185,"XG","000001",50,411]
My State is
this.setState({ mode: "demo", filename: "Sample Dataset: Tips", pivotState: { data: tips, rows: ["cor"], cols: ["tamanho"], aggregatorName: "Integer Sum", vals: ["quantidade"], rendererName: "table", sorters: { "Size": sortAs(tips.slice(1).map(tip => tip[4]).sort((a, b) => a > b))}, plotlyOptions: {width: 900, height: 500} } });
I didn't get the expected behavor (behavor that I expected).
I forked and did some change, passing an object to columns attribute.
from react-pivottable.
In this case, you'll want ...sorters: { "tamanho": sortAs(["P", "M", "G", "GG"]) }...
Basically you're adding a custom sorting rule for the "tamanho"
column ("Size"
doesn't make sense here, it doesn't refer to anything) and that rule is to sort it in this exact order: P M G GG.
from react-pivottable.
ok, I get it. thanks.
from react-pivottable.
Related Issues (20)
- Drag and drop fields from one axis to another will duplicate them in React 18 HOT 6
- Implementation issue of valueFilter?
- Manually Triggering Events on Plotly charts
- Grouping and folding feature HOT 3
- Access Result data / Export Result Data to json format HOT 2
- OnRefresh Method does not trigger on react-pivot table HOT 1
- Javascript heap out of memory issue when installing react-pivottable plotty.js react-plotly.js pluggins
- Couldn't able to sort with individual column. It would be better to have sorting option in column header
- Adding link to values
- react pivotablejs filter css z-index problem
- Adding other plotly charts types
- Typescript error in plotly.js/index.d.ts during npm run build HOT 1
- How to freeze headers and Expand and Collapse row values
- Customize heatMap color
- Not working properly with react version 18 HOT 3
- Export Table as Excel File / PDF HOT 2
- TypeError: t.hasOwnProperty is not a function HOT 1
- React Pivottable Grouping Sorting
- Custom Aggregators
- Is this still maintained ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-pivottable.