04-25-2014 04:14 PM
I am using measurement studio graph in my WPF application. For one of my graph, the plots on it sometimes becomes invisible but the graph becomes visible if I click on the axis limits or change the axis title. This only happen with one particular figure in my application and I am unsure why it is happening. I will be grateful if someone could help out with this.
Thanks.
Solved! Go to Solution.
04-28-2014 09:32 AM
From your description, changing the axis label or clicking the extremes may cause a layout pass, prompting the graph to redraw. Without knowing more about the configuration of the plots and axes in your graph or the data being shown, it is hard to what exactly is causing the issue. If you could provide a stand-alone application that reproduces the problem, it would help to quickly narrow down the problem.
04-09-2015 03:20 PM
Hi Paul,
Thanks for your answer. I was not able to recreate the problem by simply creating a simple program and cannot share out full application for confidentality issue.
The problem still occurs and I am not sure the reason why.
In the mean time, what method can I call on the graph to force the plots to be redrawn? InvalidateVisuals() and Refresh doesn't seem to be working.
Thank you.
04-09-2015 05:28 PM
Refresh
should force the plots to redraw. You might also try the WPF UpdateLayout
method, and verify that the RenderMode
property on your graph is set to an explicit value (either Vector
or Raster
, not Auto
).
04-10-2015 05:46 AM
Yes, the RenderMode is set explicitly. Another information that may help you debug this is I have recently noticed the plot disappears if I have four plots on the same graph. The first time it is plot, the figure shows but subsequenctly it doesn't appear unless you click on the axis or change the size of the application. But if instead I plot two of the plots on a secondary axis, the plot behaves normally. This is what I am doing at the moment but will like to plot all the plots on the same y-axis.
Do you know when the next measurement studio will be released? I feel the current version is too full of bugs and it is probably time a major version is released to address many of the known issues.
Thank you,
Akinola
04-10-2015 10:16 AM
What type of data are you using, and how are you sending it to the graph? I.e. analog waveforms in an observable collection? Chart collections in an array? Do you send new instances each time, or do you append data to existing instances?
To answer your other question, the next version of Measurement Studio is scheduled for release in 2015.
04-11-2015 03:56 AM
My data are of type of double and I send the data to graph using the steps below (a simplified example):
int N=35;
Point[] pt = new Point[N];
for (int i = 0; i < N; i++)
{
pt[i].X = i+1;
pt[i].Y = 2.1e-1 * (i + 1) * (i + 1);
}
Plot plt = new Plot("Total ");
plt.Label = "Total ";
PointPlotRenderer pltr = new PointPlotRenderer();
SolidColorBrush br = new SolidColorBrush(Colors.Red);
pltr.Stroke = br;
pltr.Fill = br;
plt.Renderer = (PlotRenderer)pltr;
plt.HorizontalScale = xAxis;
plt.VerticalScale = yAxis;
niGraph.Plots.Add(plt);
niGraph.Data[0] = pt;
I send new data each time to the plot and also I have created my own usercontrol chart using the Measurement Studio graph as the starting point in case that is useful for debugging.
Thank you for the asnwer about the next version of measurement studio.
04-13-2015 10:51 AM
You mentioned a user control chart. Could your problem be related to the issue described in the Graph lost Plots forum question?
04-18-2015 09:00 AM
Thanks for your message but that is not my issue, my RenderMode is already set explicity. I am finally able to create something I can share with you with that strange behaviour. I will send you a private message with the attachment.
04-19-2015 01:01 PM
I sent the project to you. Please run the project and click Simulate to see the strange behavior. Thanks.