MultiBar

All the code described so far in this chapter is centered on the creation of a class that defines a single bar or data value, so how are all these individual bars consolidated together and displayed in a graph? Well, there are two possible approaches: We can either display each SimpleBar as an individual object on the SimpleGraph container, or we can use the MultiBar class to present like bars together.

The MultiBar class provides functionality to iterate through a number of SimpleBar classes, and make each bar visible against an appropriate axis scale. The code required in the {constructor} for MultiBar is shown in Figure 17-13.

As the MultiBar class will actually render the bars that will be displayed to the user, it inherits from ...

Get Enterprise Curl now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.