Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

WPF graph plots not visible

Solved!
Go to solution

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.

0 Kudos
Message 1 of 12
(8,022 Views)

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.

~ Paul H
0 Kudos
Message 2 of 12
(8,003 Views)

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.

0 Kudos
Message 3 of 12
(6,985 Views)

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).

~ Paul H
0 Kudos
Message 4 of 12
(6,981 Views)

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

0 Kudos
Message 5 of 12
(6,969 Views)

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.

~ Paul H
0 Kudos
Message 6 of 12
(6,959 Views)

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.

0 Kudos
Message 7 of 12
(6,947 Views)

You mentioned a user control chart. Could your problem be related to the issue described in the Graph lost Plots forum question?

~ Paul H
0 Kudos
Message 8 of 12
(6,922 Views)

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.

0 Kudos
Message 9 of 12
(6,884 Views)

I sent the project to you. Please run the project and click Simulate to see the strange behavior. Thanks.

0 Kudos
Message 10 of 12
(6,874 Views)