PHP-GTK2 Newsletter
|
Sample Code 445: How to dynamically scale a bar graph using scrollbars - Part 1 - y direction? |
| Written by kksou | ||||||
| Friday, 29 February 2008 | ||||||
|
Problem This is in response to Paamayim's post titled 'smooth scrolling for a gtkimage drawing'. He has set up a bar graph and wants to allow the user to dynamically change the scale of the x-axis and y-axis through the scrollbars as shown below. As there are quite a number of techniques involved, to make it easier to follow, I've spread the techniques over 5 parts:
Solution
Sample Code
Explanation We make use of the code from How to draw a simple bar graph using GD2? to set up the bar graph. What's new here:
Note
This example serves mainly to illustrate the use of GtkAdjustment and GtkVScrollbar. I will leave it to you to optimize and polish the gd2 portion (for the display of the bar graph). Related Links
|
||||||
| < Prev | Next > |
|---|




