-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…15724) Signed-off-by: Jose C Quintas Jr <juniorquintas@gmail.com> Co-authored-by: Jose C Quintas Jr <juniorquintas@gmail.com> Co-authored-by: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com>
- Loading branch information
1 parent
24927a7
commit e177f9d
Showing
8 changed files
with
197 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as React from 'react'; | ||
import { BarChart } from '@mui/x-charts/BarChart'; | ||
|
||
export default function GradientTooltip() { | ||
return ( | ||
<BarChart | ||
sx={{ | ||
'--my-custom-gradient': 'url(#GlobalGradient)', | ||
}} | ||
slotProps={{ | ||
popper: { | ||
sx: { | ||
'--my-custom-gradient': 'linear-gradient(0deg, #123456, #81b2e4);', | ||
}, | ||
}, | ||
}} | ||
series={[ | ||
{ | ||
label: 'series A', | ||
data: [50], | ||
}, | ||
{ | ||
label: 'series B', | ||
data: [100], | ||
color: 'var(--my-custom-gradient, #123456)', | ||
}, | ||
]} | ||
width={400} | ||
height={200} | ||
> | ||
<linearGradient id="GlobalGradient" x1="0%" y1="100%" x2="0%" y2="0%"> | ||
<stop offset="0" stopColor="#123456" /> | ||
<stop offset="1" stopColor="#81b2e4" /> | ||
</linearGradient> | ||
</BarChart> | ||
); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as React from 'react'; | ||
import { BarChart } from '@mui/x-charts/BarChart'; | ||
|
||
export default function GradientTooltip() { | ||
return ( | ||
<BarChart | ||
sx={{ | ||
'--my-custom-gradient': 'url(#GlobalGradient)', | ||
}} | ||
slotProps={{ | ||
popper: { | ||
sx: { | ||
'--my-custom-gradient': 'linear-gradient(0deg, #123456, #81b2e4);', | ||
}, | ||
}, | ||
}} | ||
series={[ | ||
{ | ||
label: 'series A', | ||
data: [50], | ||
}, | ||
{ | ||
label: 'series B', | ||
data: [100], | ||
color: 'var(--my-custom-gradient, #123456)', | ||
}, | ||
]} | ||
width={400} | ||
height={200} | ||
> | ||
<linearGradient id="GlobalGradient" x1="0%" y1="100%" x2="0%" y2="0%"> | ||
<stop offset="0" stopColor="#123456" /> | ||
<stop offset="1" stopColor="#81b2e4" /> | ||
</linearGradient> | ||
</BarChart> | ||
); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import * as React from 'react'; | ||
import { PieChart } from '@mui/x-charts/PieChart'; | ||
|
||
export default function PatternPie() { | ||
return ( | ||
<PieChart | ||
sx={{ | ||
'--my-custom-pattern': 'url(#Pattern)', | ||
}} | ||
series={[ | ||
{ | ||
data: [ | ||
{ id: 0, value: 10, label: 'series A' }, | ||
{ id: 1, value: 15, label: 'series B' }, | ||
{ | ||
id: 2, | ||
value: 20, | ||
label: 'series C', | ||
color: 'var(--my-custom-pattern, #123456)', | ||
}, | ||
], | ||
}, | ||
]} | ||
width={400} | ||
height={200} | ||
> | ||
<pattern | ||
id="Pattern" | ||
patternUnits="userSpaceOnUse" | ||
width="20" | ||
height="40" | ||
patternTransform="scale(0.5)" | ||
> | ||
<rect x="0" y="0" width="100%" height="100%" fill="#123456" /> | ||
<path | ||
d="M0 30h20L10 50zm-10-20h20L0 30zm20 0h20L20 30zM0-10h20L10 10z" | ||
strokeWidth="1" | ||
stroke="#81b2e4" | ||
fill="none" | ||
/> | ||
</pattern> | ||
</PieChart> | ||
); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import * as React from 'react'; | ||
import { PieChart } from '@mui/x-charts/PieChart'; | ||
|
||
export default function PatternPie() { | ||
return ( | ||
<PieChart | ||
sx={{ | ||
'--my-custom-pattern': 'url(#Pattern)', | ||
}} | ||
series={[ | ||
{ | ||
data: [ | ||
{ id: 0, value: 10, label: 'series A' }, | ||
{ id: 1, value: 15, label: 'series B' }, | ||
{ | ||
id: 2, | ||
value: 20, | ||
label: 'series C', | ||
color: 'var(--my-custom-pattern, #123456)', | ||
}, | ||
], | ||
}, | ||
]} | ||
width={400} | ||
height={200} | ||
> | ||
<pattern | ||
id="Pattern" | ||
patternUnits="userSpaceOnUse" | ||
width="20" | ||
height="40" | ||
patternTransform="scale(0.5)" | ||
> | ||
<rect x="0" y="0" width="100%" height="100%" fill="#123456" /> | ||
<path | ||
d="M0 30h20L10 50zm-10-20h20L0 30zm20 0h20L20 30zM0-10h20L10 10z" | ||
strokeWidth="1" | ||
stroke="#81b2e4" | ||
fill="none" | ||
/> | ||
</pattern> | ||
</PieChart> | ||
); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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