[automated] update diyhrt.market
@@ -7,7 +7,7 @@
|
||||
|
||||
@font-face {
|
||||
font-family: "Nunito Sans";
|
||||
src: url("https://diyhrt.market/static/fonts/NunitoSans-Italic-VariableFont_YTLC,opsz,wdth,wght.ttf");
|
||||
src: url("../fonts/NunitoSans-Italic-VariableFont_YTLC,opsz,wdth,wght.ttf");
|
||||
font-weight: 200 1000;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 377 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 183 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 380 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 183 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 117 KiB |
|
After Width: | Height: | Size: 127 KiB |
@@ -0,0 +1,116 @@
|
||||
const priceChartElement = document.getElementById("price-chart");
|
||||
const priceChartData = JSON.parse(document.getElementById("pricechart-data").textContent);
|
||||
|
||||
function skipped(ctx, value) {
|
||||
output = !ctx.p0.raw.in_stock ? value : undefined;
|
||||
return output;
|
||||
}
|
||||
|
||||
priceChartData.datasets.forEach(
|
||||
function (dataset) {
|
||||
dataset.segment = {
|
||||
borderColor: ctx => skipped(ctx, "rgba(0, 0, 0, 0)")
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
function afterLabelGen(tooltipItem) {
|
||||
return tooltipItem.raw.state;
|
||||
}
|
||||
|
||||
|
||||
let start_date = new Date();
|
||||
start_date.setDate(start_date.getDate() - 365);
|
||||
|
||||
|
||||
let priceChart = new Chart(
|
||||
priceChartElement,
|
||||
{
|
||||
type: 'line',
|
||||
data: priceChartData,
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
scales: {
|
||||
xAxis: {
|
||||
type: "time",
|
||||
min: start_date,
|
||||
max: new Date(),
|
||||
},
|
||||
yAxis: {
|
||||
}
|
||||
},
|
||||
interaction: {
|
||||
intersect: false,
|
||||
axis: 'xAxis'
|
||||
},
|
||||
plugins: {
|
||||
legend: {
|
||||
labels: {
|
||||
// This more specific font property overrides the global property
|
||||
font: {
|
||||
family: '"Nunito Sans", Cambria, "Times New Roman", Times, serif',
|
||||
size: 16
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
callbacks: {
|
||||
afterLabel: afterLabelGen,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
const actions = [
|
||||
{
|
||||
name: 'Step: false (default)',
|
||||
handler: (chart) => {
|
||||
chart.data.datasets.forEach(dataset => {
|
||||
dataset.stepped = false;
|
||||
});
|
||||
chart.update();
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Step: true',
|
||||
handler: (chart) => {
|
||||
chart.data.datasets.forEach(dataset => {
|
||||
dataset.stepped = true;
|
||||
});
|
||||
chart.update();
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Step: before',
|
||||
handler: (chart) => {
|
||||
chart.data.datasets.forEach(dataset => {
|
||||
dataset.stepped = 'before';
|
||||
});
|
||||
chart.update();
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Step: after',
|
||||
handler: (chart) => {
|
||||
chart.data.datasets.forEach(dataset => {
|
||||
dataset.stepped = 'after';
|
||||
});
|
||||
chart.update();
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Step: middle',
|
||||
handler: (chart) => {
|
||||
chart.data.datasets.forEach(dataset => {
|
||||
dataset.stepped = 'middle';
|
||||
});
|
||||
chart.update();
|
||||
}
|
||||
}
|
||||
];
|
||||