This project is read-only.

How to sync the vertical axis tick width of 2 charts

Nov 23, 2009 at 12:57 PM
Edited Nov 25, 2009 at 9:44 AM

Hard to explain so I've linked to a picture. I have two charts that have matching horizontal axis. They are stacked on top of each other in the view so that you can compare them vertically.

My problem is that the vertical axis ticks are dynamically sized and so they can differ between the two charts - this means that they no longer line up vertically.

How do you suggest that I solve this and have the vertical axis width matched so that they are the same on both charts regardless of the calculated tick size?

Nov 24, 2009 at 8:03 PM


In the next uploaded to Source Code version of DynamicDataDisplay there will be a class named "WidthSpring" which will help you to have equal widths of two chart plotters' LeftPanels. Here is a sample of usage:


<d3:ChartPlotter Visible="-25000,-14000,50000,28000" Name="plotter1"/>
<d3:ChartPlotter Visible="-25000,-2,50000,4" Name="plotter2">
	<d3:WidthSpring SourcePanel="{Binding LeftPanel, ElementName=plotter1}"/>

Best regards,



Nov 25, 2009 at 9:35 AM
Edited Nov 25, 2009 at 9:45 AM

Great. Will keep any eye out for the next check-in.

Apr 19, 2010 at 2:40 PM
Edited Apr 19, 2010 at 3:52 PM
I need to create a Chart exactly like the image posted above. Has the WidthSpring been introduced in any of the releases yet? I'm pretty sure I have the latest and do not see it. EDIT: My apologies its here:
Apr 19, 2010 at 2:46 PM

Take a look at change set 31108 on the source code tab.

Apr 19, 2010 at 4:00 PM

Thanks, This seems to be working pretty good from some simple testing.  I used the viewport restrictions example to lock the x-axis navigations together.


       Dim V As New ViewportRestrictionCallback(AddressOf Callback)

        plotter2.Viewport.Restrictions.Add(New InjectionDelegateRestriction(plotter.Viewport, V))

    Public Function Callback(ByVal rect As DataRect) As DataRect

        rect.XMin = plotter.Viewport.Visible.XMin

        rect.Width = plotter.Viewport.Visible.Width

        Return rect

    End Function

Oct 21, 2010 at 12:11 PM

Has anyone used the WidthSpring approach for more than 2 charts?

The SyncedWidthSample works well for 2 charts, but I am unsure how to make it work for more.  We can have at least 5 or 6 together, which I want to keep synced.  

I've tried adding a WidthSpring as children for each (so they all have WidthSprings for each other), but it doesn't work too well, especially when you add new charts.  Can it be done?