Repository: holoviz/holoviews

Issue:
bar plot multi_level=False issues with Bokeh backend in Safari
Setting `multi_level=False` for a bar plot sets `major_label_text_font_size` = `0pt` (see https://github.com/holoviz/holoviews/blob/main/holoviews/plotting/bokeh/chart.py#L802). This does not work well in Safari which simply ignores "too small" fonts, leading to displayed, overlapping labels (see screenshot below).

As an alternative one could set `major_label_text_alpha` to 0, `major_label_text_line_height` to 0 and `major_label_text_font_size` to `1px` to hide the labels:
```
props['major_label_text_font_size'] = '1px'
props['major_label_text_alpha'] = 0
props['major_label_text_line_height'] = 0
```

Possibly there could also be a nicer solution, avoiding these hacks to hide the labels altogether, using `major_label_overrides` or a custom ticker?

![image](https://user-images.githubusercontent.com/435646/229205500-4a0b14b2-6732-4090-b529-b0d803f05b9d.png)




Discussion:
Can you share a [minimal, reproducible example (MRE)](https://stackoverflow.com/help/minimal-reproducible-example)?

I would like to fiddle around with the settings myself.  


Apologies for the delay...

This triggers the problem for me with holoviews==1.14.9, bokeh==2.4.2, hvplot==0.8.0.
```python
import pandas as pd
import holoviews as hv
import hvplot.pandas
hv.extension('bokeh')
pdf = pd.DataFrame({"ATLAS":{"Mar":1.0,"Apr":2.0},"CMS":{"Mar":3.0,"Apr":4.0}})
plt = pdf.hvplot(kind='bar', responsive=True, height=430).opts(multi_level=False)
hv.save(plt, 'sample.html', backend='bokeh')
```

Depending on the Safari version, it either renders with the second-level labels not hidden as expected (recent safari versions) or even breaks completely rendering with "invalid bbox" (older versions):
![image](https://user-images.githubusercontent.com/435646/233869863-96a048aa-7969-4b76-99eb-d13847962559.png)


Adding the following hook works around the issue for all Safari versions I tested:
```python
def hv_single_level_barplot_workaround(plot, element):
    xaxis = plot.handles['xaxis']
    if (not plot.multi_level) and xaxis.major_label_text_font_size == '0pt':
        xaxis.major_label_text_font_size = '1px'  # safari does not like 0pt
        xaxis.major_label_text_alpha = 0
        xaxis.major_label_text_line_height = 0
```
This looks fine for me running Holoviews=1.16:

Bokeh 2.4.3
![image](https://github.com/holoviz/holoviews/assets/19758978/8288cb11-4957-4f4f-8cfd-ddeb95241408)

Bokeh 3.1.1
![image](https://github.com/holoviz/holoviews/assets/19758978/0c573b52-ca4d-4aac-851e-18b2b25ba299)

Looks broken in 3.1.1 looking at your screenshot above.
See also https://github.com/holoviz/holoviews/issues/5726
I was mainly talking about the missing font, but yes, the bar is broken in 3.1.1. 
Also in 2.4.3 the output is not correct in Safari, although it's not that obvious: multi_level=False should suppress the second-level category axis ("ATLAS" / "CMS" in my example). This is actually what is shown in the screenshot in the first post.

The expected output would be this:
![image](https://github.com/holoviz/holoviews/assets/435646/52a374a7-1acd-4ecb-97f1-7d3b7801081b)

Resolving patch:
diff --git a/holoviews/plotting/bokeh/chart.py b/holoviews/plotting/bokeh/chart.py
--- a/holoviews/plotting/bokeh/chart.py
+++ b/holoviews/plotting/bokeh/chart.py
@@ -797,7 +797,12 @@ def _axis_properties(self, axis, key, plot, dimension=None,
             ((not self.invert_axes and axis == 'x') or (self.invert_axes and axis =='y'))):
             props['separator_line_width'] = 0
             props['major_tick_line_alpha'] = 0
-            props['major_label_text_font_size'] = '0pt'
+            # The major_label_text_* is a workaround for 0pt font size not working in Safari.
+            # See: https://github.com/holoviz/holoviews/issues/5672
+            props['major_label_text_font_size'] = '1px'
+            props['major_label_text_alpha'] = 0
+            props['major_label_text_line_height'] = 0
+
             props['group_text_color'] = 'black'
             props['group_text_font_style'] = "normal"
             if axis == 'x':


Test patch: