Report 3: Bar/Line Chart
Listing 12.8 is the source for barline_utils.c, the code functions that are called from callbacks.c (for the third report) to create the bar/line chart.
Listing 12.8. barline_utils.c
#include <gtk/gtk.h> #include <mysql.h> /* stdlib.h is needed for the atoi/atof call. */ #include <stdlib.h> #include "support.h" #define SERVER "einstein" #define LOGIN "kbi_user" #define PASS "dengissa" #define DB "kbi" #define BASELINE_CHART 350 //the number of pixels from the top //of the drawingarea to the "baseline" //of the bars in the bar graph #define BASELINE_MONTHS 370 //the number of pixels down to draw //the month names #define SCALE_DENOMINATOR 1235 //the division factor to scale the bars //and lines to the drawingarea #define ... |
Get MySQL Building User Interfaces 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.