highcharts - Wind Rose with pulsating marker? - Stack Overflow

I am having some difficulties using the pulsating marker you can see on this example, but on a wind ros

I am having some difficulties using the pulsating marker you can see on this example, but on a wind rose in highchart.

When trying to recreate it, it looks like the animation only shows on the left side of the container?

Here's my fiddle to illustrate my problem.

        series.pulse
        .attr({
            x: series.xAxis.toPixels(point.x, true),
            y: series.yAxis.toPixels(point.y, true),
            r: series.options.marker.radius,
            opacity: 1,
            fill: series.color
        })
        .animate({
            r: 20,
            opacity: 0
        }, {
            duration: 1000
        });

I am having some difficulties using the pulsating marker you can see on this example, but on a wind rose in highchart.

When trying to recreate it, it looks like the animation only shows on the left side of the container?

Here's my fiddle to illustrate my problem.

        series.pulse
        .attr({
            x: series.xAxis.toPixels(point.x, true),
            y: series.yAxis.toPixels(point.y, true),
            r: series.options.marker.radius,
            opacity: 1,
            fill: series.color
        })
        .animate({
            r: 20,
            opacity: 0
        }, {
            duration: 1000
        });
Share Improve this question asked Mar 3 at 11:50 AlphaFr34kAlphaFr34k 111 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

You need to convert cartesian coordinates to the polar ones in your plugin, something along these lines:

    ...
    const point = e.point,
        series = e.target,
        chart = series.chart,
        renderer = chart.renderer,
        angle = point.x,
        radius = point.y;

    const centerX = chart.plotWidth / 2 + chart.plotLeft;
    const centerY = chart.plotHeight / 2 + chart.plotTop;
    const radians = deg2rad(angle); //you can easily define such helper
    const x = centerX + radius * Math.cos(radians);
    const y = centerY + radius * Math.sin(radians);

That change should help to position the pulsating point within the plot area, then, you need to find a way to connect the pulse with the new points.

Happy charting!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745096172a4610990.html

相关推荐

  • highcharts - Wind Rose with pulsating marker? - Stack Overflow

    I am having some difficulties using the pulsating marker you can see on this example, but on a wind ros

    19小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信