Beautiful, Dynamic Charts

Nathan Schmidt, Senior UI Developer

Article Categories: #Design & Content, #Code, #Front-end Engineering

Posted on

Animated data visualization that matches the design is no longer a challenge as Rive makes it fast to build and deploy pixel-perfect dynamic charts.

Showing data graphically is a challenge, and sometimes chart JS libraries don’t quite fit. But building something from scratch is just not in the budget. 

Visuals are key when it comes to presenting data. Especially when that data is the primary focus of a page. Sometimes coding a custom solution is too time-consuming and expensive, and standard charting libraries don't quite work. Enter Rive, a powerful tool that can be used to build dynamic, design-focused graphs and charts.

A Powerful Solution

Rive offers a compelling solution. It allows you to import SVG designs directly from your design files, ensuring your charts perfectly match your aesthetic. You can then animate these designs using keyframes and blend timelines, creating dynamic charts that respond to data in real-time.

Rive eliminates the need to build custom-coded graphics, saving valuable development time. These dynamic charts from Rive are small and compact and usually end up being around the size of a medium image, 200-800kb.

Because you can import SVG files directly into Rive, it allows for pixel-perfect implementation of the designs. Designers don’t have to guess what the final graphic will look like, they can design it right in Figma and it can be brought to life in Rive.

Real-World Application

In a recent project, we needed to create three different charts. After looking at the designs, I knew all three would not fit a standard JavaScript library without a lot of custom development. This is when I started looking to Rive to build out these charts.  Having used Rive on other projects for simple animations, I was curious to see if it could flex to meet the challenge of showing me data on a chart.

Here are the three charts that we needed to create:

  • A speed dial chart that showed a percentage from 0 to 100.
  • A bar chart showing several different bars and data points.
  • A grid chart plotting a dot on an x and y coordinate.

I was able to export each chart from Figma as an SVG and then set up inputs for the values that needed to be passed into Rive. Then I blended two animation timelines for each value to animate from the lowest number to the highest. Once everything was set up in Rive, I added them to the web app and passed the data to the element using data attributes

Speed, Bar, and Grid charts

All three of these would have been very time-consuming to build, but using Rive made it a straightforward process. The greatest benefit is that all three charts dynamically work with the data and match the designs exactly. 

Limitations 

Rive will not work for every chart situation. There are a few limitations to consider. When building the Rive chart, we have to animate the beginning and ending of each chart point. If the chart only has one to five data points, Rive may still be a great option. But once there are more data points, animating all those keyframes is going to be very time-consuming. 

The other limitation is that any edits to the chart will need to be made in Rive. If, halfway through the project, a new data point gets added, it will need to be added in Rive and then hooked up again to your data. 

If there are a lot of data points or if new data will need to be added later on, Rive may not be the best option. Think about switching to a JavaScript library to handle the volume of data and design to the capabilities and specifications of that library.

In my experience, Rive works best with small data points, and where presenting data visually is the top priority.

Where Design and Data Meet

Rive bridges the gap between design and data visualization in a way that saves development time over coding a custom solution. Its intuitive interface and powerful animation capabilities make it an ideal tool for creating stunning and interactive charts. While Rive has its limitations with charts, it is an amazing tool that can bring your data to life in a way that's both beautiful and informative. 

Nathan Schmidt

Nathan is a Senior UI Developer in Colorado. He loves applying creative thinking to web development and bringing interactive components to life.

More articles by Nathan

Related Articles