@davidr,
Are you looking for something like this? Also please have a look at location.pathname documentation page for more info.
In case this doesn’t solve your requirement, please share some pictorial representation or explain the problem in more detailed way, so that we can understand your requirement in a better way and help you out.
___
Suyash Singh
Team CanvasJS