Slider

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "usermeta": {
    "deneb": {
      "build": "1.3.0.0",
      "metaVersion": 1,
      "provider": "vegaLite",
      "providerVersion": "5.2.0"
    },
    "interactivity": {
      "tooltip": true,
      "contextMenu": true,
      "selection": true,
      "highlight": true,
      "dataPointLimit": 50
    },
    "information": {
      "name": "Sliders",
      "description": "[No Description Provided]",
      "author": "Kerry Kolosko",
      "uuid": "2cc4776b-f329-4fdc-bc46-dd5b0b8e283e",
      "generated": "2022-07-21T02:53:33.678Z"
    },
    "dataset": [
      {
        "key": "__0__",
        "name": "Category",
        "description": "",
        "type": "text",
        "kind": "column"
      },
      {
        "key": "__1__",
        "name": "Data",
        "description": "",
        "type": "numeric",
        "kind": "measure"
      }
    ]
  },
  "config": {
    "view": {"stroke": "transparent"},
    "font": "Segoe UI",
    "arc": {},
    "area": {
      "line": true,
      "opacity": 0.6
    },
    "bar": {},
    "line": {
      "strokeWidth": 3,
      "strokeCap": "round",
      "strokeJoin": "round"
    },
    "path": {},
    "point": {
      "filled": true,
      "size": 75
    },
    "rect": {},
    "shape": {},
    "symbol": {
      "strokeWidth": 1.5,
      "size": 50
    },
    "text": {
      "font": "Segoe UI",
      "fontSize": 12,
      "fill": "#605E5C"
    },
    "axis": {
      "ticks": false,
      "grid": false,
      "domain": false,
      "labelColor": "#605E5C",
      "labelFontSize": 12,
      "titleFont": "wf_standard-font, helvetica, arial, sans-serif",
      "titleColor": "#252423",
      "titleFontSize": 16,
      "titleFontWeight": "normal"
    },
    "axisQuantitative": {
      "tickCount": 3,
      "grid": true,
      "gridColor": "#C8C6C4",
      "gridDash": [1, 5],
      "labelFlush": false
    },
    "axisX": {"labelPadding": 5},
    "axisY": {"labelPadding": 10},
    "header": {
      "titleFont": "wf_standard-font, helvetica, arial, sans-serif",
      "titleFontSize": 16,
      "titleColor": "#252423",
      "labelFont": "Segoe UI",
      "labelFontSize": 13.333333333333332,
      "labelColor": "#605E5C"
    },
    "legend": {
      "titleFont": "Segoe UI",
      "titleFontWeight": "bold",
      "titleColor": "#605E5C",
      "labelFont": "Segoe UI",
      "labelFontSize": 13.333333333333332,
      "labelColor": "#605E5C",
      "symbolType": "circle",
      "symbolSize": 75
    }
  },
  "data": {"name": "dataset"},
  "layer": [
    {
      "mark": {
        "type": "bar",
        "opacity": 0.3,
        "cornerRadius": 50,
        "color": "red",
        "tooltip": true
      },
      "encoding": {
        "x": {"field": "__1__"}
      }
    },
    {
      "mark": {
        "type": "bar",
        "cornerRadius": 50,
        "color": "red",
        "tooltip": true
      },
      "encoding": {
        "x": {
          "field": "__1____highlight"
        },
        "opacity": {
          "condition": {
            "test": {
              "field": "__selected__",
              "equal": "off"
            },
            "value": 0
          },
          "value": 1
        }
      }
    },
    {
      "mark": {
        "type": "bar",
        "opacity": 0.3,
        "cornerRadius": 50,
        "color": "grey",
        "tooltip": true
      },
      "encoding": {"x": {"datum": 1}}
    },
    {
      "mark": {
        "type": "text",
        "tooltip": true,
        "align": "left",
        "baseline": "middle",
        "x": 30,
        "fontWeight": "bold",
        "color": "white"
      },
      "encoding": {
        "text": {
          "field": "__1__",
          "format": ".0%"
        }
      }
    }
  ],
  "encoding": {
    "y": {
      "field": "__0__",
      "type": "nominal",
      "title": ""
    },
    "x": {
      "type": "quantitative",
      "axis": false
    }
  }
}

Leave a comment

Your email address will not be published. Required fields are marked *