Forum Discussion
X-axis label formatting not responding in a Line chart with multiple series of time-series data
- 9 months ago
Hi _Matthew_ ,
this morning working on a line chart I remembered your posting and had an idea for a solution.
What do you think about this one:
Basic ideas are:
- Make the x-axis labels invisible
- Disable vertical grid lines
- Add 12 reference lines, each as a x-axis constant line for the beginning of a month
- Add some extra space to center the labels
Are you interested in the details?
Working on this, a second idea came to my mind: Adding a dummy line with zero values and use custom data labels to get the x-axis labels. But unfortunately all data field for custom labels are greyed out. Obviously Power BI doesn't allow custom labels if you have more than one series (resulting from more than one y-axis entries or a legend entry). So that would be only an option for exactly one line.
Correction:
Multiples lines are possible, only the legend entry has to be avoided. If its an option for you to have separate measures for every year, the following could be an option too:
(no manual adding of 12 reference lines and no manual correction of label positions)
_Matthew_ To the best of my knowledge, you effectively lose all control over the format of the x-axis dates when you use Continuous instead of Categorical. Your best bet is likely to place small shapes over top of the years to hide them. Hacky but should work. You could also turn the x-axis off completely and maybe use an image or something in it's place that has the formatting you want or even another visual perhaps that displays the "categorical" months.
The following image is down with 2 line chart visuals, one with Continuous x-axis turned off and the second underneath it of Categorical.
GeraldGEmerick Thank you. We have done exactly that in other places. It does work, sort of. It seems like something that should be brought into the realm of controllable.
- GeraldGEmerick9 months ago
Memorable Member
_Matthew_ I absolutely agree that you should be able to control that.