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

Update Threshold with button click #22

Open
MongouseIt opened this issue Jan 31, 2020 · 0 comments
Open

Update Threshold with button click #22

MongouseIt opened this issue Jan 31, 2020 · 0 comments

Comments

@MongouseIt
Copy link

MongouseIt commented Jan 31, 2020

Hello,

I'm trying update the threshold and the whole chart with a click event, but the threshold doesn't changes. The chart axys updating as expected but threshold stays at the default value.

I'm updating the chart like this:

function ChangeChart(_low, _high, _threshold){
  mychart.update({
    labels: _labels,
    series: _series
  }, {
    low: _low,
    high: _high,
    showArea: true,
    plugins: [
       Chartist.plugins.ctThreshold({
         threshold: _threshold
        })
     ]
  });
}

$(document).ready(function(){
  $('button').click(function(){
     var _threshold = 2; //default is 4
     var _low = 2.5; //default is 3.5
     var _high = 5.5; //default is 6.5
     ChangeChart(_low, _high, _threshold);
   });
});

Is there a way to update the threshold. Am I doing something wrong?

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

No branches or pull requests

1 participant