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)
PowerBI Please take a look at this thread. It seems that we have outlined a legitimate use case which isn't well supported in the current state of development. Thanks!
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_9 months agoRegular Visitor
Hans-Georg_Puls That's a good work around! I can see how to replicate it using pieces which I had overlooked. Those work arounds are good enough to call it a solution!
A true fix in PBI is still needed, but for the motivated a path has been shown, thank you!
Previously, using similar techniques I arrived at the image below, where the 'name' Calendar Year replaces the months and the tool tip carries the specific date for someone trying to look deeper into the timing of the events. The quarterly separations are 'Reference Lines' marked to the start date of each quarter of the year. The same technique as the month approach. I had not moved so aggressively to label each line and adjust other aspects of the X-axis to achieve what you showed. Without playing with it, I think that this scales a little better when stretched or resized, but doesn't carry as much detail. A trade-off.