houdini/app/javascript/legacy/components/chart-options.js

30 lines
635 B
JavaScript
Raw Normal View History

2019-11-06 20:36:28 +00:00
// License: LGPL-3.0-or-later
var chartOptions = {}
chartOptions.default = {
defaultFontFamily: "'Open Sans', 'Helvetica Neue', 'Arial', 'sans-serif'"
, scales: {
yAxes: [{ ticks: { min: 0 }}]
}
}
chartOptions.dollars = {
defaultFontFamily: "'Open Sans', 'Helvetica Neue', 'Arial', 'sans-serif'"
, scales: {
yAxes: [{ ticks: {
min: 0
, callback: (val) => '$' + utils.cents_to_dollars(val)
} }]
}
, tooltips: {
callbacks: {
label: (item, data) =>
data.datasets[item.datasetIndex].label +
': $' + utils.cents_to_dollars(item.yLabel)
}
}
}
module.exports = chartOptions