The creation of magnetic storage devices by decoration of a graphene sheet by magnetic transition-metal adatoms, utilizing the high in-plane versus out-of-plane magnetic anisotropy energy (MAE), has recently been proposed. This concept is extended in our density-functional-based modeling study by incorporating the influence of the graphene edge on the MAE. We consider triangular graphene flakes with both armchair and zigzag edges in which a single ruthenium adatom is placed at symmetrically inequivalent positions. Depending on the edge-type, the graphene edge was found to influence the MAE in opposite ways: for the armchair flake the MAE increases close to the edge, while the opposite is true for the zigzag edge. Additionally, in-plane pinning of the magnetization direction perpendicular to the edge itself is observed for the first time.