Hi @valeriabreveglieri. Here’s another try … does this look like what you’re looking for?
If so, here’s the Deneb/Vega-Lite JSON code:
{
"data": {"name": "dataset"},
"encoding": {
"x": {
"field": "Month Name",
"type": "nominal",
"axis": {"labelAngle": 0},
"sort": {
"op": "sum",
"field": "MonthOfYear",
"order": "ascending"
},
"title": "Month"
},
"y": {
"field": "Total Sales",
"type": "quantitative"
},
"color": {
"condition": {
"param": "hover",
"field": "Year",
"type": "ordinal",
"legend": null,
"scale": {
"scheme": "pbiColorNominal"
}
},
"value": "grey"
},
"opacity": {
"condition": {
"param": "hover",
"value": 1
},
"value": 0.2
}
},
"layer": [
{
"params": [
{
"name": "hover",
"value": [{"Year": 2021}],
"select": {
"type": "point",
"fields": ["Year"],
"on": "mouseover"
}
}
],
"mark": {
"type": "line",
"tooltip": true,
"strokeWidth": 5
},
"encoding": {
"tooltip": [
{
"field": "Year",
"type": "quantitative"
},
{
"field": "Month Name",
"type": "nominal",
"title": "Month"
},
{
"field": "Total Sales",
"type": "quantitative",
"title": "Sales",
"formatType": "pbiFormat",
"format": "$#,0"
}
]
}
},
{
"name": "ENDPOINT_CIRCLE",
"mark": {
"type": "circle",
"size": 200,
"opacity": 1
},
"encoding": {
"color": {
"condition": [
{
"test": "datum['MonthOfYear'] == 12",
"value": "black"
}
],
"value": "transparent"
}
}
},
{
"name": "ENDPOINT_LABEL",
"mark": {
"type": "text",
"align": "left",
"xOffset": 10,
"fontSize": 20
},
"encoding": {
"text": {
"field": "Year",
"type": "quantitative"
},
"color": {
"condition": [
{
"test": "datum['MonthOfYear'] == 12",
"value": "black"
}
],
"value": "transparent"
}
}
}
]
}
Hope it helps.
Greg
eDNA Forum - Deneb Sales by Month by Year.pbix (1.7 MB)