Tick marks for both axes display garbled

Dec 16, 2013 at 5:45 PM
Edited Dec 16, 2013 at 5:46 PM
Hello,

I am attempting to plot trends of data within a graph that shows nominal, upper tolerance, and lower tolerance values. The graphs are created in WPF by a UniformGrid layout.

One issue I keep running into is the axes tick marks, both inside of the graph and the numbers on the axes themselves, display garbled and are clearly incorrect--but only for a couple of the graphs:
Image

Note that for Graph 5 and Graph 6, the red, blue, and black lines are actually plotted correctly. If I resize the window or zoom in on the graph, everything snaps into place and the garbled numbers and lines go away.

I've tried numerous things--InvalidateVisual, ForceUpdate, InvalidateArrange, etc.--on the chart, MainVerticalAxis, MainHorizontalAxis...but nothing seems to fix this problem.

Any ideas on how to fix this?

EDIT: Here's the full-sized image--http://i.imgur.com/BSqtGlh.png
Apr 2, 2014 at 10:09 AM
I've had similar problem. In my case axis was not showing up when chart was rendered for the first time. I've also tried UpdateLayout() and it didn't help. It depends when you call it. In my case problem was fixed by calling UpdateLayout() on ChartPlotter before adding a chart to the plotter.

Let me know if that helped in your case :).

Regards,
virious
Apr 2, 2014 at 5:18 PM
I did end up fixing this recently thanks to some timely placed UpdateLayout() calls--added one to mainGrid_SizeChanged in AxisControl just before UpdateUI(), and another one in UpdateUI:
        if (!IsMeasureValid)
        {
            InvalidateMeasure();
            UpdateLayout();
        }
and had to remove this line from AxisBase:
axisControl.MakeDependent();

It didn't quite seem that the logic was quite correct--the InitTransform was only being called once but not after there was some guarantee of when a render actually happened. Just guessing. It's certainly more expensive to force these, but at least it's working properly :)