File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,36 @@ $ bundle
7171
72722) start using :)
7373
74+ ### Webpack / esbuild
75+
76+ 1) Run:
77+
78+ ```bash
79+ yarn add echarts
80+ ```
81+
82+ #### For Rails 7
83+ 2) In `app/javascript/application.js` add this:
84+
85+ ```javascript
86+ import * as echarts from 'echarts';
87+ import 'echarts/theme/dark';
88+
89+ window.echarts = echarts;
90+ ```
91+
92+ #### For Rails 6
93+ 2) In `app/javascript/packs/application.js` add this:
94+
95+ ```javascript
96+ import * as echarts from 'echarts';
97+ import 'echarts/theme/dark';
98+
99+ window.echarts = echarts;
100+ ```
101+
102+ 3) start using :)
103+
74104### Importmaps
75105
761061) change `config/importmap.rb`
@@ -98,7 +128,7 @@ import "rails_charts/echarts.min.js"
98128## Options
99129
100130```ruby
101- <%= link_chart data, {
131+ <%= line_chart data, {
102132 width: '250px',
103133 height: '250px',
104134 theme: 'dark',
You can’t perform that action at this time.
0 commit comments