retention chart
This commit is contained in:
parent
2547c8c117
commit
8b73f215eb
5 changed files with 236 additions and 47 deletions
|
@ -39,6 +39,7 @@ import * as os from '@/os';
|
|||
import { defaultStore } from '@/store';
|
||||
import { useChartTooltip } from '@/scripts/use-chart-tooltip';
|
||||
import { chartVLine } from '@/scripts/chart-vline';
|
||||
import { alpha } from '@/scripts/color';
|
||||
|
||||
const props = defineProps({
|
||||
src: {
|
||||
|
@ -101,13 +102,6 @@ Chart.register(
|
|||
|
||||
const sum = (...arr) => arr.reduce((r, a) => r.map((b, i) => a[i] + b));
|
||||
const negate = arr => arr.map(x => -x);
|
||||
const alpha = (hex, a) => {
|
||||
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)!;
|
||||
const r = parseInt(result[1], 16);
|
||||
const g = parseInt(result[2], 16);
|
||||
const b = parseInt(result[3], 16);
|
||||
return `rgba(${r}, ${g}, ${b}, ${a})`;
|
||||
};
|
||||
|
||||
const colors = {
|
||||
blue: '#008FFB',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue