O'Reilly logo

Enterprise Curl by Paul Sheehan

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

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 ...

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