Skip to content

Commit

Permalink
cahnged barchart to be normal barchart
Browse files Browse the repository at this point in the history
  • Loading branch information
YapSengKuang committed Oct 13, 2023
1 parent 9892b32 commit 8a7be28
Showing 1 changed file with 17 additions and 48 deletions.
65 changes: 17 additions & 48 deletions js/interactiveBarchart.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,19 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "A bar chart with highlighting on hover and selecting on click. (Inspired by Tableau's interaction style.)",
"width": 230,

"data": {
"url": "data/Top10fbusersbycountry.csv"
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "A bar chart with highlighting on hover and selecting on click. (Inspired by Tableau's interaction style.)",
"width": 230,
"data": {
"url": "data/Top10fbusersbycountry.csv"
},
"params": [
{
"name": "highlight",
"select": {"type": "point", "on": "mouseover"}
},
{"name": "select", "select": "point"}
],
"mark": {
"type": "bar",
"fill": "#4C78A8",
"stroke": "black",
"cursor": "pointer"
},
"encoding": {
"x": {"field": "userPer10k", "type": "quantitative"},
"y": {"field": "Country", "type": "nominal", "sort": "-x"},
"fillOpacity": {
"condition": {"param": "select", "value": 1},
"value": 0.3
},
"strokeWidth": {
"condition": [
{
"param": "select",
"empty": false,
"value": 2
},
{
"param": "highlight",
"empty": false,
"value": 1
}
],
"value": 0
}
},
"config": {
"scale": {
"bandPaddingInner": 0.2
}
}
}
"mark": {
"type": "bar"
},
"encoding": {
"x": {"field": "userPer10k", "type": "quantitative", "title": "Number of users"},
"y": {"field": "Country", "type": "nominal", "sort": "-x"},
"tooltip": [
{"field": "Country", "type": "nominal", "title": "Country"},
{"field": "userPer10k", "type": "quantitative", "title": "Number of Users"}
]
}
}

0 comments on commit 8a7be28

Please sign in to comment.