.. | ||
app | ||
bin | ||
config | ||
db | ||
lib | ||
log | ||
public | ||
storage | ||
test | ||
tmp | ||
vendor | ||
.gitattributes | ||
.gitignore | ||
.ruby-version | ||
config.ru | ||
copy_charting_library_files.sh | ||
Gemfile | ||
Gemfile.lock | ||
Rakefile | ||
README.md |
TradingView Charting Library and Ruby on Rails Integration Example.
The earliest supported version of the charting library for these examples is v23.043
.
How to start
-
Check that you can view https://github.com/tradingview/charting_library/. If you do not have access then you can request access to this repository here.
-
Install Ruby. This example was created using Ruby 3.2.0
-
Install Ruby on Rails. This example was created using Rails 7.0.4.2
-
Install Rails dependencies with
bundle install
. You may encounter an error that would require you to perform abundle update
. -
Copy the charting library files
- If you are able to run bash scripts then the
copy_charting_library_files.sh
script can be used to copy the current stable version's files. - If you are not able to run bash scripts then do the following:
- Copy
charting_library
folder from https://github.com/tradingview/charting_library/ to/public
. - Copy
datafeeds
folder from https://github.com/tradingview/charting_library/ to/public
.
- Copy
- If you are able to run bash scripts then the
-
Run
rails s
and openhttp://localhost:3000
.
Note that the charting library files are intentionally not included in the Rails asset pipeline. Fingerprinting the charting_library files will break the library so we put the files directly into public
. In development mode Rails will serve these public files for you. In production you would need to ensure that the files in public
are served by your production webserver.
What is Charting Library
Charting Library is a standalone solution for displaying charts. This free, downloadable library is hosted on your servers and is connected to your data feed to be used in your website or app. Learn more and download.
What is Ruby on Rails
A web-application framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern. Ruby on Rails is open source software and there are many of the applications that were built with Ruby on Rails such as Basecamp, GitHub, Shopify, Airbnb, Twitch, SoundCloud, Hulu, Zendesk, Square, Highrise, Cookpad. Learn more.