mirror of
https://github.com/samsonjs/spirit-tracker.git
synced 2026-04-27 15:07:43 +00:00
fixes
This commit is contained in:
parent
7bc61f7efb
commit
023fb4f0a4
1 changed files with 26 additions and 1 deletions
|
|
@ -3,6 +3,31 @@ import { fetchJson, inferGithubOwnerRepo, githubFetchFileAtSha, githubListCommit
|
||||||
|
|
||||||
let _chart = null;
|
let _chart = null;
|
||||||
|
|
||||||
|
|
||||||
|
const STORE_LABELS = {
|
||||||
|
bcl: "BCL",
|
||||||
|
bsw: "BSW",
|
||||||
|
coop: "Co-op World of Whisky",
|
||||||
|
craftcellars: "Craft Cellars",
|
||||||
|
gull: "Gull Liquor",
|
||||||
|
kegncork: "Keg N Cork",
|
||||||
|
kwm: "Kensington Wine Market",
|
||||||
|
legacy: "Legacy Liquor",
|
||||||
|
legacyliquor: "Legacy Liquor",
|
||||||
|
maltsandgrains: "Malts & Grains",
|
||||||
|
sierrasprings: "Sierra Springs",
|
||||||
|
strath: "Strath Liquor",
|
||||||
|
tudor: "Tudor House",
|
||||||
|
vessel: "Vessel Liquor",
|
||||||
|
vintage: "Vintage Spirits",
|
||||||
|
willowpark: "Willow Park",
|
||||||
|
};
|
||||||
|
|
||||||
|
function displayStoreName(storeKey) {
|
||||||
|
const k = String(storeKey || "").toLowerCase();
|
||||||
|
return STORE_LABELS[k] || storeKey;
|
||||||
|
}
|
||||||
|
|
||||||
export function destroyStatsChart() {
|
export function destroyStatsChart() {
|
||||||
try {
|
try {
|
||||||
if (_chart) _chart.destroy();
|
if (_chart) _chart.destroy();
|
||||||
|
|
@ -356,7 +381,7 @@ export async function renderStats($app) {
|
||||||
});
|
});
|
||||||
|
|
||||||
const datasets = stores.map((s) => ({
|
const datasets = stores.map((s) => ({
|
||||||
label: s,
|
label: displayStoreName(s),
|
||||||
data: Array.isArray(seriesByStore[s]) ? seriesByStore[s] : labels.map(() => null),
|
data: Array.isArray(seriesByStore[s]) ? seriesByStore[s] : labels.map(() => null),
|
||||||
spanGaps: false,
|
spanGaps: false,
|
||||||
tension: 0.15,
|
tension: 0.15,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue