Forum Discussion
Deneb Vega-Lite Axis Label Font Color
Hi,
I have written the below code, but I am trying to make the font color on the X-Axis the same as the Title color. everything I have tried either makes the Title change, or produces an error (Validation: should NOT have additional properties of #/additionalProperties).
Can anyone help please?
Thank you
{
"title": {"text": "Average"},
"config": {
"view": {"stroke": "transparent"},
"font": "Pirenaica",
"title": {"fontSize": 30, "color":"#039d95"}},
"data": {"name": "dataset"},
"layer": [
{
"mark": {
"type": "area",
"interpolate": "step",
"tooltip": true,
"color": {
"x1": 1,
"y1": 1,
"y2": 0.5,
"gradient": "linear",
"stops": [
{
"offset": 0,
"color": "#039d95"
},
{
"offset": 1,
"color": "#E8580D"
}
]
}
}
}
],
"encoding": {
"x": {
"field": "durationtimeblock",
"type": "ordinal",
"sort": {"field": "durationsort"},
"title": null,
"axis": {"labelFont": "Pirenaica","labelFontSize": 8}
},
"y": {
"field": "Average of durationcount",
"type": "quantitative",
"axis": null
}
}
}
Hi Xiaoxin,
I accidently found a solution by adding this to the config, not sure if it is right, but it works!
"config": {
"style": {"guide-label": {"fill": "#8F95A1"}},thank you anyway
2 Replies
- AnonymousNot applicable
HI MiniVolcano,
If this custom visual return the error message when you try to apply colors to multiple fields, it may mean currently this does not support. You may need to manually config them twice at their properties.
Regards,
Xiaoxin Sheng
- MiniVolcanoFrequent Visitor
Hi Xiaoxin,
I accidently found a solution by adding this to the config, not sure if it is right, but it works!
"config": {
"style": {"guide-label": {"fill": "#8F95A1"}},thank you anyway