src/graph_gui.cpp
changeset 5793 01b18d4550e2
parent 5791 7b2a5160ee31
child 5796 3e1a1281a9dc
equal deleted inserted replaced
5792:c4dad358b30b 5793:01b18d4550e2
   180 				year++;
   180 				year++;
   181 			}
   181 			}
   182 			x += GRAPH_X_POSITION_SEPARATION;
   182 			x += GRAPH_X_POSITION_SEPARATION;
   183 		}
   183 		}
   184 	} else {
   184 	} else {
   185 		/* Add 8 to make the string appear centred between the lines. */
   185 		/* Draw the label under the data point rather than on the grid line. */
   186 		x = gw->left + GRAPH_X_POSITION_BEGINNING + 8;
   186 		x = gw->left + GRAPH_X_POSITION_BEGINNING + (GRAPH_X_POSITION_SEPARATION / 2) + 1;
   187 		y = gw->top + gw->height + 1;
   187 		y = gw->top + gw->height + 1;
   188 		uint16 label = gw->x_values_start;
   188 		uint16 label = gw->x_values_start;
   189 
   189 
   190 		for (int i = 0; i < gw->num_on_x_axis; i++) {
   190 		for (int i = 0; i < gw->num_on_x_axis; i++) {
   191 			SetDParam(0, label);
   191 			SetDParam(0, label);
   192 			DrawString(x, y, STR_01CB, GRAPH_AXIS_LABEL_COLOUR);
   192 			DrawStringCentered(x, y, STR_01CB, GRAPH_AXIS_LABEL_COLOUR);
       
   193 
   193 			label += gw->x_values_increment;
   194 			label += gw->x_values_increment;
   194 			x += GRAPH_X_POSITION_SEPARATION;
   195 			x += GRAPH_X_POSITION_SEPARATION;
   195 		}
   196 		}
   196 	}
   197 	}
   197 
   198