Comments (6)
Hi @MainaMwangiy we currently don't support that use-case. The closest you can get currently is a border around all of the "stacks" by reimplementing the Bar
element.
export const Bar = styled(animated.rect, {
name: 'MuiBarElement',
slot: 'Root',
overridesResolver: (_, styles) => styles.root,
})<{ ownerState: BarElementOwnerState }>(({ ownerState }) => ({
fill: ownerState.isHighlighted
? d3Color(ownerState.color)!.brighter(0.5).formatHex()
: ownerState.color,
transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
opacity: (ownerState.isFaded && 0.3) || 1,
strokeWidth: 5,
// This here, use your data instead of seriesA.data
stroke: ownerState.dataIndex === seriesA.data.length - 1 ? 'black' : 'none',
}));
You can find the code here: https://stackblitz.com/edit/react-6fcijw?file=Demo.tsx
from mui-x.
@JCQuintas Thanks for the prompt response. But I am facing a challenge using it with ResponsiveChartContainer. I want to have the black outline as you gave above based on a condition like if Average is present, then it should have a black outline. Please check the example and use case I am using. (https://stackblitz.com/edit/react-xh8m58?file=Demo.tsx)
from mui-x.
You could try to pass categories as ownerState
through the slotProps
as shown here: https://stackblitz.com/edit/react-xh8m58-yzhwyy?file=Demo.tsx
from mui-x.
@JCQuintas Again, Thanks for the swift response. The solution has now fully fixed my issue. Thank you.
from mui-x.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
@MainaMwangiy: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.
from mui-x.
@JCQuintas I am facing one more issue on this. If I have a lot of options with 0,1,2 values, then the black outline color gets clamped together. And the UI looks bad. Check attached example. Is there a way to only show the outline on the outer stack borders? Without having the strike tough lines that are from left to right on the stacks.
What I am getting at the moment when I have may options.
Please let me know if there is a way and if we can reopen this until I get a full solution.
from mui-x.
Related Issues (20)
- Pie Chart shows a slice for 0 value whenever the object representing a 0 is last in the array HOT 2
- [DataGrid] CSV export negative numbers in string has quotation HOT 3
- [data grid] Is there a way to override the default copy/paste functionality in DataGrid? HOT 6
- New sets of components HOT 3
- [charts] BarChart legend overlaps charts area HOT 2
- [pickers] Recipes HOT 1
- [data grid] I want to add Apply and Cancel buttons to the GridToolbarFilterButton HOT 5
- [pickers][DateTimeRangePicker] Manually selecting the date then selecting the time in the popover reverts the date to today HOT 1
- [charts] Support single color area chart HOT 4
- [data grid] Row pinning with Server-side tree data HOT 1
- [data grid] `isRowSelectable` lags behind state updates HOT 1
- [charts] Replace `d3-color` by CSS filter
- [data grid] On callapsing an expanded row, the nested table/container retains the size of expanded state HOT 1
- [pickers] Inconsistent design of DatePicker and DateRangePicker HOT 2
- [charts] Add a "seriesIndex" Property to the AxisContent Custom Charts Tooltip in an AreaPlot HOT 5
- [charts] "dataIndex" Property is not available to the "itemContent" Custom Charts Tooltip in an AreaPlot HOT 1
- [DataGrid] Data header filter with Autocomplete not working
- [DataGrid] Updating rowHeight and pagination model doesn't display all page rows
- [DataGrid] Position aggregation row on top (as first row) instead of bottom
- [data grid-premium] Copy and Paste content from origin column cell selection to an another column doesn't maintain the sorting set
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 mui-x.