Fix some bugs

    - Add a random color generator, if there is no color left in the
palette.
    - Add an overflow on legend if its too big for the container.