question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Controller defined by "classic" style does not work

See original GitHub issue

Expected Behavior

As written on the documentation, the “classic” style should define new chart.

Current Behavior

Using the classic style, reported into documentation, you got an error:

Code
function Custom() {
  Chart.controllers.line.call(this, arguments);
}

Custom.prototype.draw = function() {
	Chart.controllers.line.prototype.draw.call(this, arguments);
}

Custom.id = 'myline';
Custom.defaults = Chart.defaults.line;

Chart.registry.addControllers(Custom);
Error
Uncaught Error: "myline" is not a registered controller.
    _get https://www.chartjs.org/dist/master/chart.js:5651
    getController https://www.chartjs.org/dist/master/chart.js:5601
    buildOrUpdateControllers https://www.chartjs.org/dist/master/chart.js:6131
    update https://www.chartjs.org/dist/master/chart.js:6168
    Chart https://www.chartjs.org/dist/master/chart.js:5949
    <anonymous> pen.js:44

Steps to Reproduce

https://codepen.io/stockinail/pen/MWKBvRQ

See the browser console log.

Environment

  • Chart.js version: dist/master
  • Browser name and version: FF 78.0.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
kurklecommented, Jul 13, 2020

I did open a PR, but if you want to improve the documentation, you’re welcome!

1reaction
kurklecommented, Jul 13, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Controller not working in macOS 12.3 - Apple Developer
I tried to connect my xbox controller to my MacBook, even though the controller is registered in bluetooth setting, but it doesn't function...
Read more >
Model View Controller Explained - Tom Dalling
Model view controller (MVC) is a very useful and popular design pattern. ... The model represents the data, and does nothing else.
Read more >
Classical control theory - Wikipedia
Classical control theory is a branch of control theory that deals with the behavior of dynamical systems with inputs, and how their behavior...
Read more >
Version Control Tab is missing – IDEs Support (IntelliJ Platform)
What's new' says there is new commit tool window so it mean the old was replaced. No single word about Version Tab. You...
Read more >
Handling common JavaScript problems - MDN Web Docs
Now we'll look at common cross-browser JavaScript problems and how to ... modern browsers do a good job of supporting "classic JavaScript ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found