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

Sinatra support for Chart.js and Highcharts #549

Closed
blakegearin opened this issue Oct 13, 2020 · 1 comment · May be fixed by freesteph/watchdog#13
Closed

Sinatra support for Chart.js and Highcharts #549

blakegearin opened this issue Oct 13, 2020 · 1 comment · May be fixed by freesteph/watchdog#13

Comments

@blakegearin
Copy link

Is your feature request related to a problem? Please describe.
While using chartkick.js with Sinatra it seems the charting library being used is Google Charts. I would like to be able to switch between Chart.js, Google Charts, and Highcharts

Describe the solution you'd like

  1. Provide different flavors chartkick.js for different charting libraries
    OR
  2. More documentation around how to use the existing chartkick.js with Chart.js and Highcharts. For instance, do other .js files need to be downloaded and included with a script tag? If so, what should be downloaded?

Additional context
For Chart.js I tried the following:

  1. Downloaded Chart.min.js version 2.9.3 from a Chart.js CDN (raw file)
  2. Added line 3 to my layout.haml file (which was previously working, displaying a chart using Google Charts))
1 %script{ src: '//www.google.com/jsapi' }
2 %script{ type: 'text/javascript', src: "/javascripts/chartkick.js" }
3 %script{ type: 'text/javascript', src: "/javascripts/Chart.min.js" }
  1. Got this error in the browser console:
chartkick.js:1763 Uncaught Error: This method is not implemented: either no adapter can be found or an incomplete integration was provided.
@ankane ankane closed this as completed in 3c23d6c Oct 13, 2020
@ankane
Copy link
Owner

ankane commented Oct 13, 2020

Hey @blakegearin, thanks for the suggestion! You'll need to use Chart.bundle.js instead of Chart.min.js. I've expanded the docs in the readme.

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

Successfully merging a pull request may close this issue.

2 participants