grayman1234
Posts: 5
Joined: Sat Sep 16, 2023 9:34 am

How to make gradients in spiderweb?

Sat Sep 16, 2023 9:44 am

Hi! I'm struggling how to make the spiderweb pane(I mean the area of the hexagon) have gradient color like this image

Only thing I found was filling the pane part.
and this code didn't work for me.

Code: Select all

color: {
    linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
    stops: [
        [0, '#003399'],
        [1, '#3366AA']
    ]
}
Is there a way to fill with gradient color?

and one more question, how do I make the circle line dashed?
Is there only straight lines?
Attachments
11.PNG
11.PNG (23.67 KiB) Viewed 100 times

jakub.s
Posts: 984
Joined: Fri Dec 16, 2022 11:45 am

Re: How to make gradients in spiderweb?

Mon Sep 18, 2023 12:42 pm

Hi,

Welcome to our forum & thanks for the question!

1. You can:
- define a gradient with defs
- easily add a gradient to a certain SVG element via CSS

2. You can:
- define a dasharray
- set a stroke-dasharray attribute on the axis-line element

Here's a demo: https://jsfiddle.net/BlackLabel/3qo7vaLw/
Links you may find helpful:
- https://developer.mozilla.org/en-US/doc ... -dasharray
- https://www.highcharts.com/docs/chart-d ... d-patterns
- https://api.highcharts.com/class-refere ... ement#attr

Please let me know if that helps.

Best regards!
Jakub
Highcharts Developer

grayman1234
Posts: 5
Joined: Sat Sep 16, 2023 9:34 am

Re: How to make gradients in spiderweb?

Wed Sep 20, 2023 2:56 am

jakub.s wrote:
Mon Sep 18, 2023 12:42 pm
Thank you for the reply. But I think I wrote the question little wrong. I was finding the gradient of the background white part not the data part.
But I really apprecate your help!
And the dash part works good.

jakub.s
Posts: 984
Joined: Fri Dec 16, 2022 11:45 am

Re: How to make gradients in spiderweb?

Wed Sep 20, 2023 6:40 am

Sorry for the misunderstanding.

You can change the "background" part, not the "data" part by simply changing the CSS class affected.

Here's a demo: https://jsfiddle.net/BlackLabel/e51zjvwm/

Is that what you were looking for?

Kind regards!
Jakub
Highcharts Developer

grayman1234
Posts: 5
Joined: Sat Sep 16, 2023 9:34 am

Re: How to make gradients in spiderweb?

Thu Sep 21, 2023 10:51 am

jakub.s wrote:
Wed Sep 20, 2023 6:40 am
Thank You! :D

Return to “Highcharts Usage”