mirror of
https://github.com/olehomelchenko/minivlat-local-ua.git
synced 2025-12-21 21:22:24 +00:00
Update chart configurations to set fixed width and enhance export options in quiz
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"values": [
|
"values": [
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"values": [
|
"values": [
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"url": "data/barchart.csv", "format": {"type": "csv"}
|
"url": "data/barchart.csv", "format": {"type": "csv"}
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"mark": {
|
"mark": {
|
||||||
"type": "bar"
|
"type": "bar"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"url": "data/barchart.csv", "format": {"type": "csv"}
|
"url": "data/barchart.csv", "format": {"type": "csv"}
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"mark": {
|
"mark": {
|
||||||
"type": "bar"
|
"type": "bar"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"url": "data/bubblechart.csv"
|
"url": "data/bubblechart.csv"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"url": "data/bubblechart.csv"
|
"url": "data/bubblechart.csv"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 500,
|
"height": 500,
|
||||||
"projection": {
|
"projection": {
|
||||||
"type": "albersUsa"
|
"type": "albersUsa"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
|
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
|
||||||
"height": 500,
|
"height": 500,
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"title": "Кількість шлюбів в першому півріччі 2024 р.",
|
"title": "Кількість шлюбів в першому півріччі 2024 р.",
|
||||||
"config": {
|
"config": {
|
||||||
"padding": 0,
|
"padding": 0,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"url": "data/histogram.csv"
|
"url": "data/histogram.csv"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"url": "data/histogram.csv"
|
"url": "data/histogram.csv"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
|
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"title": "Oil Prices",
|
"title": "Oil Prices",
|
||||||
"data": {
|
"data": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
|
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"title": "Ціни на нафту",
|
"title": "Ціни на нафту",
|
||||||
"data": {
|
"data": {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"titleFontWeight": "bold"
|
"titleFontWeight": "bold"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"width": "container", "height": 400,
|
"width": 800, "height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"values": [
|
"values": [
|
||||||
{"brand": "Samsung", "share": 17.6},
|
{"brand": "Samsung", "share": 17.6},
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"titleFontWeight": "bold"
|
"titleFontWeight": "bold"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"width": "container", "height": 400,
|
"width": 800, "height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"values": [
|
"values": [
|
||||||
{"brand": "Samsung", "share": 17.6},
|
{"brand": "Samsung", "share": 17.6},
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"url": "data/scatterplot.csv"
|
"url": "data/scatterplot.csv"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"url": "data/scatterplot.csv"
|
"url": "data/scatterplot.csv"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"url": "data/stacked100.csv"
|
"url": "data/stacked100.csv"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"encoding": {
|
"encoding": {
|
||||||
"y": {
|
"y": {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"url": "data/stacked100.csv"
|
"url": "data/stacked100.csv"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"encoding": {
|
"encoding": {
|
||||||
"y": {
|
"y": {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"values": [
|
"values": [
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontWeight": "bold"
|
"fontWeight": "bold"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"data": {
|
"data": {
|
||||||
"values": [
|
"values": [
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"url": "data/stackedbarchart.csv"
|
"url": "data/stackedbarchart.csv"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"encoding": {
|
"encoding": {
|
||||||
"x": {
|
"x": {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"url": "data/stackedbarchart.csv"
|
"url": "data/stackedbarchart.csv"
|
||||||
},
|
},
|
||||||
"width": "container",
|
"width": 800,
|
||||||
"height": 400,
|
"height": 400,
|
||||||
"encoding": {
|
"encoding": {
|
||||||
"x": {
|
"x": {
|
||||||
|
|||||||
@@ -79,7 +79,16 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
|
|
||||||
// Embed the Vega-Lite chart
|
// Embed the Vega-Lite chart
|
||||||
const embedOptions = {
|
const embedOptions = {
|
||||||
actions: false, // Disable kebab menu
|
downloadFileName: `${question.chart}-${version}`,
|
||||||
|
actions: {
|
||||||
|
export: {
|
||||||
|
svg: true,
|
||||||
|
png: true
|
||||||
|
},
|
||||||
|
source: false,
|
||||||
|
compiled: false,
|
||||||
|
editor: false
|
||||||
|
},
|
||||||
tooltip: false // Disable tooltips
|
tooltip: false // Disable tooltips
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user