Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Line plot with categorical x-axis is too wide

I need a scatter plot where the x-axis is a datetime and the y-axis takes values from 0 to 4. 

 

If I choose "scatter chart" in visualization, the datetime is taken as "linear" and I get a scatter plot of only 5 points, one for each of the y-axis categories. I am not given the option to set datetime as "categorical" in this case.

 

I found a workaround by choosing the "line chart", that allows me to set the x-axis as categorical. If I set stroke to 0, the line chart becomes the scatter chart that I am looking for. However, the separation between the points is really large. I would like them to be closer to each other even if the name of all categories (my datetimes) are not shown, because I would like to see a bigger datetime span (ideally a whole day). Is that possible? 

 

My plot when I choose "scatter chart"My plot when I choose "scatter chart"My plot when I choose "line chart"My plot when I choose "line chart"

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @v-cherch-msft 

 

thanks a lot for your help, that is not a good option for me, because actually all the data point come from a single day. I really need to show all points, not aggregated at any level. 

 

What I have done at the end is converting the time into a numerical continuous value. This allows me to use the scatter plot and I get the result that I need. 

 

Thanks in any case

View solution in original post

3 REPLIES 3
v-cherch-msft
Employee
Employee

Hi @Anonymous 

You may add a column to get the date column like below in query editor.Then use the date column as x-axis in line chart.

a1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-cherch-msft 

 

thanks a lot for your help, that is not a good option for me, because actually all the data point come from a single day. I really need to show all points, not aggregated at any level. 

 

What I have done at the end is converting the time into a numerical continuous value. This allows me to use the scatter plot and I get the result that I need. 

 

Thanks in any case

Hi @Anonymous 

Glad to hear you've solved it, please accept your reply as solution, that way, other community members will easily find the solution when they get same issue.

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors