gionkunz / chartist-plugin-threshold

Threshold Plugin for Chartist.js
Do What The F*ck You Want To Public License
29 stars 38 forks source link

Support for multiple thresholds #21

Closed osteenbergen closed 2 years ago

osteenbergen commented 5 years ago

chartist_thresholds

gionkunz commented 5 years ago

Hey thanks! I appreciate the feature! Will look into the PR soon.

robkaper commented 4 years ago

Precisely what I need, would love for this to be included.

xuancongwen commented 4 years ago

@gionkunz Any chance of this getting a code review?

maxbond2 commented 4 years ago

Used this plugin mod for one of my project - it saved a lot of time for me! @osteenbergen, thank you very much!

One note. When several charts initialised with different thresholds, you have to manually set uniqe mask names for each chart!

chris-hippo commented 4 years ago

Do you have some example code for this? I'm struggling to set up multiple thresholds and style each differently, I only have ct-threshold-below and ct-threshold-above to work with?

osteenbergen commented 4 years ago

Depending on the prefixThreshold setting you have area-<index> available.

option.thresholds = [75, 50, 25]

.ct-point {
  stroke-width: 5px;
}
.ct-point.ct-threshold-above {
  stroke: green;
}
.ct-point.ct-threshold-area-0 {
  stroke: yellow;
}
.ct-point.ct-threshold-area-1 {
  stroke: orange;
}
.ct-point.ct-threshold-below {
  stroke: red;
}
osteenbergen commented 4 years ago

@gionkunz Its been a year, any luck on merging this PR? Do you require improvements?

markterrill commented 3 years ago

great stuff! Seems quite a lot of the chartist repo's are not being maintained

osteenbergen commented 2 years ago

Closing this PR as this project is not maintained....