master: change repo

This commit is contained in:
Julien Calixte
2019-08-22 11:50:32 +02:00
commit dbd63d341c
263 changed files with 26153 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import IPoint from '@/models/IPoint'
import { money } from '@/utils/filters'
import ICurrency from '@/models/ICurrency'
class ChartService {
public valueToPoint(value: number, index: number, total: number): IPoint {
const x = 0
const y = -value * 1.6
const angle = ((Math.PI * 2) / total) * index
const cos = Math.cos(angle)
const sin = Math.sin(angle)
const tx = x * cos - y * sin + 200
const ty = x * sin + y * cos + 200
return {
x: tx,
y: ty
}
}
public getLabel(user: string, cost: number, currency: ICurrency): string {
if (!user) {
return ''
}
return `${user} (${money(cost, currency)})`
}
}
export default new ChartService()