added some debugging and fixed the way that the charts are attached to the document: charts can now be attached to named elements. PROBLEM: for some reason the scales are redrawn, but the data locations are never adjusted