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

Conditional formatting on line chart on the basis of yaxis values #335

Open
tmatetwar opened this issue Jun 11, 2024 · 1 comment
Open

Comments

@tmatetwar
Copy link

I am using apexchart library to render linechart in our client environment.
One of the requirement from client is line chart color should be according to below conditions

if y-axis value <= 0.25 : green
if y-axis value > 0.25 && <0.6 : Yellow
if y-axis value > 0.6 : red

but right now it is not behaving in this manner, I tried using gradient but it looks like it works on % basis let me show you output

image

and below id the code responsible for this -
if (this.showGradient) {
this.chartOptions.fill = {
type: 'gradient',
gradient: {
shade: 'dark',
shadeIntensity: 1,
type: 'vertical',
opacityFrom: 1,
opacityTo: 1,
colorStops: [
{
offset: 10,
color: "#ef5350",
opacity: 1,
},
{
offset: 30,
color: "#ffa726",
opacity: 1,
},
{
offset: 50,
color: "#ffca28",
opacity: 1,
},
{
offset: 70,
color: "#66bb6a",
opacity: 1,
},
],
}
}
}

    can someone please help here ??

001

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant