Contents Previous Next

8.2.1 Adjusting the width of the bars

JpGraph allows you to easy customize the appearance of the bar graph, for example to change the width of each bar. The width of each bar can be specified either as a fraction of the width between each major tick or as an absolute width (in pixels).

To set the width in fraction you use the method SetWidth() and to set the width in pixels you use the SetAbsWidth()

As an example let's take the previous example and set the width to 100% of the distance between the ticks. The example will now become



Figure 30: Setting the width of the bars to 100% of the tick width [src] 


Contents Previous Next