def get_snapping_pos_line_chart_vertical(data_objects, line_pos):
    """
    Calculates the nearest pos of and objects from a line chart with an vertical line.

    :param data_objects: The nodes of the data objects in the chart.
    :type data_objects: dict[str, PolyLineNode]
    :param line_pos: The necessary position of the node of the line according to the orientation.
    :type line_pos: float
    :return: The nearest pos (x) of an data object in the given chart.
    :rtype: float
    """
    nearest_pos = []
    for node in data_objects.itervalues():
        nearest_pos.append(sorted(node.pos, key=lambda pos: abs(line_pos - pos[0]))[0])
    return sorted(nearest_pos, key=lambda pos: abs(line_pos - pos[0]))[0][0]