public updateOptions()

in desktop/src/app/components/job/graphs/tasks-running-time-graph/tasks-running-time-graph.component.ts [79:138]


    public updateOptions() {
        const hitRadius = this.interactive ? 3 : 0;
        this.options = {
            responsive: true,
            maintainAspectRatio: false,
            animation: { duration: 0 },
            legend: {
                display: false,
            },
            elements: {
                point: {
                    radius: 1,
                    hitRadius: hitRadius,
                    hoverRadius: hitRadius,
                },
                line: {
                    backgroundColor: "rgba(0, 0, 0 ,0)",
                    borderWidth: 0,
                    borderColor: "rgba(0, 0, 0, 0)",
                    fill: false,
                },
            },
            tooltips: {
                enabled: true,
                mode: "single",
                callbacks: {
                    title: (tooltipItems, data) => {
                        return this._getToolTip(tooltipItems[0]);
                    },
                    label: () => null,
                },
            },
            scales: {
                xAxes: [{
                    display: false,
                }],
                yAxes: [{
                    type: "linear",
                    ticks: {
                        min: 0,
                        callback: (value) => {
                            if (value > 180) {
                                if (value as number % 60 === 0) {
                                    return value as number / 60 + "m";
                                }
                            } else {
                                if (value as number % 1 === 0) {
                                    return value + "s";
                                }
                            }
                        },
                    },
                    scaleLabel: {
                        display: true,
                        labelString: "Running time",
                    },
                }],
            },
        };
    }