Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple color gradient in line chart #282

Closed
jsinhSolanki opened this issue Jan 22, 2019 · 7 comments
Closed

Multiple color gradient in line chart #282

jsinhSolanki opened this issue Jan 22, 2019 · 7 comments
Labels
feature-request New feature or request

Comments

@jsinhSolanki
Copy link

Hi, I want to add multiple color in my line chart with gradient.
I tried everyting I can but chart is only getting 2 colors.

Example is here

What I want:
Multiple gradient colors. Like below
mul

@junedchhipa
Copy link
Contributor

Sorry, this is not possible currently with ApexCharts.
Maybe in future, I will provide an option to specify an unlimited number of colors in gradients.

@junedchhipa junedchhipa added the feature-request New feature or request label Jan 22, 2019
@jsinhSolanki
Copy link
Author

OK @junedchhipa

Thanks

@ghost
Copy link

ghost commented Feb 2, 2019

I need custom colors for gradients too.

@junedchhipa
Copy link
Contributor

Multiple gradient stops will be available in v3.3.2

@junedchhipa
Copy link
Contributor

junedchhipa commented Feb 17, 2019

Released 3.4.1
The multi-stops gradient is now available

screen shot 2019-02-17 at 9 48 47 am

Codepen example

@alon-loris
Copy link

How can I give the markers the relevant color as well?

@Scarecr0w9758
Copy link

Scarecr0w9758 commented Jul 11, 2024

How can I give the markers the relevant color as well?
I found out how you can do it.

Use discrete markers

image

image

1) Check how much data you need to place on chart (my case - 12 is max count, but you can pass data.length)

My series variable:
image

2) Create your array of discrete markers (I'm using Vue3 composition API). In this array you create objects that will be placed to charts option. Here you can pass the color using data indexes from your server

image

I wrote a switch-case function to get colors using my needs:
image

3) Apply your discrete markers to options:

image

4) So i got smth like that:

image

!!! Note that markers inside tooltip would be not that cool)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants