3👍
✅
You should learn to create ember components yourself, w/o relying on 3rd parties. Otherwise your life as developer always will be full of struggles. It’s especially sad in cases like this, when 3rd-party component itself is so simple.
You will need to:
- Remove
ember-cli-chart
from package.json npm install chart.js --save-dev
- In
ember-cli-build.js
file addapp.import('node_modules/chart.js/dist/Chart.js');
(look into node_modules directory to make sure this is a correct path) - Create
ember-chart.js
inapp/components
directory and put component’s code there. For code itself, you can copy from ember-cli-chart - Now in
didInsertElement
you can do with chart whatever you want
People often over-use 3rd-party ember components. Sometimes using 3rd-party component makes sense: when it is complex and provide enough flexibility and value. But often using 3rd-party components just limits you.
0👍
I found the way to do this was add multiple stops:
var ctx = document.getElementById("myChart").getContext("2d");
var gradientStroke = ctx.createLinearGradient(0, 1200, 0, 0);
gradientStroke.addColorStop(0, "#80b6f4");
gradientStroke.addColorStop(0.2, "#94d973");
gradientStroke.addColorStop(0.4, "#80b6f4");
gradientStroke.addColorStop(1, "#94d973");
Hope that helps you get started
Source:stackexchange.com