O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

Bubble chart is another two-axis chart just like area chart, line chart, and bar chart. The only difference being that the XYChart.Data object takes in the third argument in its constructor, which determines the radius of the bubble. The general idea is that the greater the bubble radius, the greater is the impact/contribution of that data point. So, in our example, we have used the sales value and the maximum sales value to determine the radius by using the formula, (sales/(maxSale  * 1d)) * 2, which means we are sizing the sales to the scale of 2.

The rest of the details are exactly similar to the other two-axis charts we have seen, namely bar charts, line charts, and area charts. Therefore, we are not going into its details ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required