Home Forums Chart Support Aligning both Y and Y2 axis across two charts Reply To: Aligning both Y and Y2 axis across two charts

#37626

Thanks for the function! I was attempting to come up with a personal solution using bounds and plotArea but your function at least works better than what I was coming up with. However it’s still not quite pixel perfect. The JSFiddle you linked has the bottom third chart just slightly out of alignment with the top two charts given its Y scale into the 1000s. With your function I’m still getting similar results when loading different sets of data having varying axes scale. I’ve seen some test cases with the Y1 axes slightly misaligned and/or the Y2 axes. Granted the margin of error is usually very small, but still noticeable and it throws off the alignment of the gridlines. Does this have to do with calculating the width of the Y axis title and labels included with the margin?

I was attempting to restructure my Excel function in Javascript using what properties CanvasJS exposes. Excel VBA had Width and InsideWidth properties for PlotArea which included and excluded the width of the axes labels respectfully.

  • This reply was modified 1 year, 11 months ago by jrobinson.
  • This reply was modified 1 year, 11 months ago by jrobinson.