This simulation illustrates the electric field generated by a line of charge, and shows how, by the principle of superposition, a continuous charge distribution can be thought of as the sum of many discrete charge elements.
A very illustrative animation of how magnetic field lines from a straight line of current are formed. The right hand rule is used to predict the direction of field lines.