You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/09/07 01:41:39 UTC
[GitHub] [incubator-echarts] wcai49 opened a new issue #13241: Series.custom.renderItem return BezierCurve will fill color in the whole area instead of being a Curve.
wcai49 opened a new issue #13241:
URL: https://github.com/apache/incubator-echarts/issues/13241
### Version
5.0.0-alpha.2
### Steps to reproduce
Just copy and paste these in any echarts online editor.
const colors = ["#1576d2", "#d14a82", "#26c1f2", "#a166ff", "#9C2BB6"]
const radius = [0.7, 0.75]
const data = [{
name: 'Mon',
value: 35
},
{
name: 'Tue',
value: 35
},
{
name: 'Wed',
value: 35
},
{
name: 'Thu',
value: 35
},
{
name: 'Fri',
value: 35
}
]
const sum = data.reduce((prev, curr) => {
curr._start = prev
curr._end = prev curr.value
return curr._end
}, 0)
function renderItem(params, api) {
const ceilAngle = Math.PI / 100 // 装饰的显示角度
const coordSys = params.coordSys
const coordRadius = coordSys.r
const val = api.value(0)
const index = api.value(1)
const r0 = coordRadius * radius[0]
const r = coordRadius * radius[1]
const startAngle = (data[index]._start * Math.PI * 2) / sum - Math.PI / 2
const endAngle = (data[index]._end * Math.PI * 2) / sum - Math.PI / 2
const points = api.coord([api.value(0), api.value(1)]);
return {
type: "group",
children: [{
type: 'sector',
shape: {
cx: coordSys.cx,
cy: coordSys.cy,
r,
r0,
startAngle: startAngle,
endAngle: endAngle
},
style: api.style({
fill: colors[index],
opacity: 0.5
})
},
{
type: 'bezierCurve',
shape: {
x1: points[0],
y1: points[1],
x2: points[0] >= coordSys.cx ? points[0] 100 : points[0] - 100,
y2: points[1] >= coordSys.cy ? points[1] 100 : points[1] - 100,
cpx1: points[0] >= coordSys.cx ? points[0] 50 : points[0] - 50,
cpy1: points[1] >= coordSys.cy ? points[1] 60 : points[1] - 60,
cpx2: points[0] >= coordSys.cx ? points[0] 50 : points[0] - 50,
cpy2: points[1] >= coordSys.cy ? points[1] - 60 : points[1] 60,
percent: 1
},
style: ({
fill: colors[index],
})
}]
}
}
option = {
color: colors,
angleAxis: {
type: 'category',
show: true,
},
radiusAxis: {
show: true
},
polar: {
radius: "75%"
},
series: [{
type: 'custom',
data: data,
renderItem: renderItem,
coordinateSystem: 'polar'
}]
}
### What is expected?
So basically the renderItem is supposed to print 5 different BezierCurves with different angles.
### What is actually happening?
The Bezier curve requires 8 variables: x1, y1, x2, y2, cpx1, cpy1, cpx2, cpy2. These 4 points declare one Bezier curve, but here they were recognized by the renderItem as an area instead of a curve.
---
I was asked to change the Pie chart's labelLine from default to the Bezier Curves. I was trying to edit the source code and it worked perfectly. However, the build function was not working well, so I cannot run the build command and pack it up after editing. Thus, I have to draw this pie chart by custom series.
Would that be another option if I submit my source code version with an additional labelLine.isBezier API? Will the Echarts developers review and merge my function into the source code? How fast it can be?
<!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
<!-- This issue is in English. DO NOT REMOVE -->
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] 100pah commented on issue #13241: Series.custom.renderItem return BezierCurve will fill color in the whole area instead of being a Curve.
Posted by GitBox <gi...@apache.org>.
100pah commented on issue #13241:
URL: https://github.com/apache/incubator-echarts/issues/13241#issuecomment-695311628
Try `stroke` instead of `fill` please.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [incubator-echarts] echarts-bot[bot] commented on issue #13241: Series.custom.renderItem return BezierCurve will fill color in the whole area instead of being a Curve.
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #13241:
URL: https://github.com/apache/incubator-echarts/issues/13241#issuecomment-687971145
Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.
In the meanwhile, please make sure that **you have posted enough image to demo your request**. You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical questions.
If you are interested in the project, you may also subscribe our [mail list](https://echarts.apache.org/en/maillist.html).
Have a nice day! 🍵
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org