Press "Enter" to skip to content

Category: Visualization

Creating a Sparkline in the New Power BI Card Visual

Erik Svensen tries out an updated visual:

In the June 23 release of Power BI desktop we has been blessed with a new card visual that not only will give a better performance compared to adding multiple cards in the past but it also gives us some formatting options we have been dreaming of for a long time.

Here is a link to the official blogpost – New card visual | Public preview | Microsoft Power BI Blog | Microsoft Power BI

On social media you have probably already seen a lot of examples of usages, and I wanted to share how you can add a sparkline to the card to make it look something like this.

Erik does a good job of showing off the capabilities of this updated card visual.

Comments closed

Shiny Apps and Fullscreen Behavior

Tim Brock gives us a demo:

Browsers have been implementing variations on a JavaScript fullscreen API for over a decade. Unfortunately, for much of that time the APIs varied across browsers. This made actually using it in production somewhat cumbersome.

Finally, with the release of Safari 16.4 in March of this year, the latest versions of all major desktop browsers now support a single, standardized interface. Legacy versions of Safari for desktop are still in use and there’s still no support at all for the Fullscreen API on iPhones; so while you can cover most users with the standardized API, it should still be for progressive enhancement and not as a fundamental requirement for operation of an application.

Click through for the script.

Comments closed

Using SHAP to Gauge Geographic Effects in R or Python

Michael Mayer runs an analysis:

This is the next article in our series “Lost in Translation between R and Python”. The aim of this series is to provide high-quality R and Python code to achieve some non-trivial tasks. If you are to learn R, check out the R tab below. Similarly, if you are to learn Python, the Python tab will be your friend.

This post is heavily based on the new {shapviz} vignette.

I appreciate the effort to include both R and Python code in this analysis, and recommend you peruse both sets of code listings.

Comments closed

Sketching before Charting

Alex Velez tries a few ideas:

It’s important to note that there isn’t a particular finding or insight that needs to be emphasized here. Instead, the goal for this visual is to provide the data in a digestible format, which will be part of a regularly updated report. That way, physicians and researchers can easily monitor any changes in the observations. 

I was unsure of the best way to approach this task, so I started sketching.

Click through to get Alex’s thought process while building a chart in Excel.

Comments closed

From Pie Chart to Stacked Bar Chart

Simon Rowe gives a multi-pie chart a once-over:

This data is from a small company that is looking to get a sense of its sales pipeline across its four regions–North, South, East and West. The data is broken into five categories which relate to the progression of any given opportunity–Prospect, Conversation, Presentation, Agreement and Formal Offer. 

The pipeline composition is expected to have minor variations between regions, but the proportion of opportunities at each stage should be consistent overall. Any notable discrepancies should be flagged to management immediately. 

Here we run into one of the main issues people have with data visualization: context is critical. A stacked bar chart is often not a good alternative for any cluster of pie charts. In this case it was a very good answer because of the nature of the exact problem to solve. If I need to make a generic report given the same raw data, it would be difficult for me to land on this specific visual.

Comments closed

Contrasting Two Visuals: Stacked Column Charts and Line Charts

Steve Jones performs a comparison:

I ran across an interesting post from Rita Fainshtein that looked at the different types of graphs for a set of data. I thought that was interesting, so I ran my own experiment. I found for my data, a line graph was better, but let me know what you think.

My data set was simple, a few players across a few events and their number of kills. I coach volleyball and I’m always trying to present stats in a useful way. Here was the small set I picked.

Something to keep note of is that line charts generally imply time series data: you are looking at some periodic activity and analyzing changes between periods.

The stacked column (or bar) chart tells you two things: the total and the first event. It’s really hard to discern any other events from a stacked chart comparison, as Steve points out.

If you don’t have periodic data or if you’re more focused on general trends than what happened at a specific event, the Cleveland dot plot (available in custom visuals) could plot each of the events, with the Y axis representing player names and the X axis representing number of kills, and each dot being a specific game. This saves a lot of real estate and gives you an idea of how points cluster, especially if you look at a larger number of games or players.

Comments closed

Rounded Corners in Power BI Error Bars

Mara Pereira trims off the edges:

If you’ve been following my posts, you probably know by now that one of the things that really annoys me in Power BI is not being able to build bar charts with rounded corners, unless you use a custom visual.

However, recently I found out about a trick to make this happen without needing to use custom visuals (special shout out to Federico Pastor who shared this trick with me!).

Read on to see how you can do this. It’s definitely not ideal, but if you absolutely need rounded corners for your bar chart, you can get them this way.

Comments closed

Testing a Power BI Theme on Existing Reports

Erik Svensen does a wardrobe upgrade:

But I want to see how my new theme might look on some old report where I might have used another theme or perhaps some reports other users have created where they have done some individual formatting instead of using the theme.

And did you know – we can do it and see the result for existing report in your workspaces – and we can directly modify the theme and see if we should change a color or a font size or a….

Read on for the process. This is a clever use of the embedding service, that’s for sure.

Comments closed

An Introduction to ggflowchart

Nicola Rennie shows off a new package:

Flowcharts can be a useful way to visualise complex processes. However, I couldn’t find an easy way to create a flowchart in R. There are a few packages for either drawing basic components of flowcharts (like {grid}), packages that are great for visualising complex network data where order doesn’t really matter (like {ggnetwork} and {igraph}), but none of them gave me the control over customisation I was used to with {ggplot2}.

{ggflowchart} tries to fill that gap. The aim of {ggflowchart} is to help R users make simple, good-looking flowcharts, with as little code as possible. It computes a layout, then uses existing {ggplot2} functions to stitch together rectangles, text, and arrows.

It does remind me a bit of Mermaid, though quite early in the process. H/T R-Bloggers.

Comments closed