Pie chart with radial gradient
See original GitHub issueApplying a radial gradient to a pie chart does not adhere to sector size/rotation, for example:
option = {
"color": [
"rgb(65, 140, 240)",
"rgb(252, 180, 65)",
"rgb(224, 64, 10)",
"rgb(5, 100, 146)",
],
"dataset": [
{
"source": [
{
"name": "A",
"value": 25,
},
{
"name": "B",
"value": 25,
},
{
"name": "C",
"value": 25
},
{
"name": "D",
"value": "25"
}
],
}
],
"series": [
{
"type": "pie",
"startAngle": 0,
"itemStyle": {
color: function (args) {
var c = option.color[args.dataIndex],
c2 = c.replace(')', ',.8)'),
c3 = c.replace(')', ',.9)')
return {
globalCoord:false,
type: 'radial',
x: 0, // calculate x
y: 0, // calculate y
r: .9,
colorStops: [
{ offset: .75, color: c3 },
{ offset: .95, color: c2 },
{ offset: 1, color: c }
]
}
}
},
}
]
}
Produces this:
While I want to have this:
Is there something builtin to help calculate x
,y
of the radial gradient for each sector ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to Create CSS Conic Gradients for Pie Charts and More
Conic and radial gradients are similar in the sense that both of them start from a specified or default point as the center...
Read more >Pie with gradient fill | Highcharts.com
Pie chart with 6 slices. All color options in Highcharts can be defined as gradients or patterns. In this chart, a gradient fill...
Read more >Pie Chart with Conic Gradient - CodePen
Pie Chart with Conic Gradient · Chris Coyier Follow. Love Run. Pen Editor Menu. Settings ... <div class="chart"></div>.
Read more >Donut with Radial Gradient - amCharts
A gradient modifier is an easy way to automatically create gradients out of the plain fill colors, for an instant stunning looks of...
Read more >Highcharts - Pie Chart with Gradient - Tutorialspoint
Highcharts - Pie Chart with Gradient, Following is an example of a Pie chart ... getOptions().colors, function (color) { return { radialGradient: {...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s better to use
global
coordinates to declare the radial gradient in your scene.The
globalCoord
in documentation is wrong. Sorry about this. Please useglobal
instead.Thank you so much for your help t
Le jeu. 8 déc. 2022 à 11:06 AM, Berke Alp Çalışkan @.***> a écrit :