No, its not mandatory. Jagged lines are used to show a break in both X or Y axis.
So, yes, you can used it in both X and Y axis, and also in any forms of graphs like histograms, bar graphs etc.
Consider that your graphs have values from 50 to 100.
It is difficult to mark all values from 0 to 100 when you only need from 50 to 100. So .You can put a jagged line from 0 to 40, as they are not needed. You can used in both X and Y axis and in all graphs.