mirror of
https://github.com/Karaka-Management/oms-RiskManagement.git
synced 2026-01-10 19:08:40 +00:00
more tests and some fixes
This commit is contained in:
parent
bd9e08010c
commit
76bb34a843
9
.github/workflows/main.yml
vendored
9
.github/workflows/main.yml
vendored
|
|
@ -13,10 +13,15 @@ on:
|
|||
- cron: '0 0 1,15 * *'
|
||||
|
||||
jobs:
|
||||
general_module_workflow:
|
||||
general_module_workflow_php:
|
||||
uses: Karaka-Management/Karaka/.github/workflows/php_template.yml@develop
|
||||
secrets:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
general_module_workflow_js:
|
||||
uses: Karaka-Management/Karaka/.github/workflows/js_template.yml@develop
|
||||
secrets:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
|
@ -3,6 +3,7 @@ import { Autoloader } from '../../../jsOMS/Autoloader.js';
|
|||
|
||||
Autoloader.defineNamespace('omsApp.Modules');
|
||||
|
||||
/* global omsApp */
|
||||
omsApp.Modules.RiskManagement = class {
|
||||
/**
|
||||
* @constructor
|
||||
|
|
@ -45,26 +46,25 @@ omsApp.Modules.RiskManagement = class {
|
|||
return;
|
||||
}
|
||||
|
||||
const self = this;
|
||||
const data = JSON.parse(chart.getAttribute('data-chart'));
|
||||
|
||||
if (data.type === 'scatter') {
|
||||
const gradientPlugin = {
|
||||
id: 'gradientPlugin',
|
||||
beforeDraw: function(chart, args, options) {
|
||||
const {ctx} = chart;
|
||||
beforeDraw: function (chart, args, options) {
|
||||
const { ctx } = chart;
|
||||
const canvas = chart.canvas;
|
||||
const chartArea = chart.chartArea;
|
||||
|
||||
// Chart background
|
||||
const gradientBack = canvas.getContext("2d").createLinearGradient(0,
|
||||
const gradientBack = canvas.getContext('2d').createLinearGradient(0,
|
||||
canvas.height,
|
||||
canvas.width, 0
|
||||
);
|
||||
|
||||
gradientBack.addColorStop(0.2, "rgba(0, 255, 0, 0.5)");
|
||||
gradientBack.addColorStop(0.55, "rgba(255, 255, 0, 0.5)");
|
||||
gradientBack.addColorStop(0.8, "rgba(255, 0, 0, 0.5)");
|
||||
gradientBack.addColorStop(0.2, 'rgba(0, 255, 0, 0.5)');
|
||||
gradientBack.addColorStop(0.55, 'rgba(255, 255, 0, 0.5)');
|
||||
gradientBack.addColorStop(0.8, 'rgba(255, 0, 0, 0.5)');
|
||||
|
||||
ctx.fillStyle = gradientBack;
|
||||
ctx.fillRect(
|
||||
|
|
@ -79,7 +79,8 @@ omsApp.Modules.RiskManagement = class {
|
|||
data.plugins = [gradientPlugin];
|
||||
}
|
||||
|
||||
/** global: Chart */
|
||||
/* global Chart */
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const myChart = new Chart(chart.getContext('2d'), data);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user