This project is read-only.

ChartPlotter resize

Nov 11, 2009 at 11:48 PM


Hi Mikhail, first of all,thanks for the excellent work!

I have some questions regarding the Plotter layout, for your best understanding, I have sent to you some screenshots. As you can see, I have three ChartPlotter on a GridView with GridSplitter, when I add vertical axis the labels are not properly drawn, also the HorizontalMinorTicks, but if you move the gridsplitter all charplotter are redraw correctly.

Another problem happens when I resize the ChartPlotter with GridSplitter (second image.)

The last problem regard the "rolling window" type graph, like the Simulation sample.
I get data points from CAN-BUS every 2 ms., I would like to show, for example, the last 1000 data points. To do this I have used the replacing array of doubles for all datasources(the number of datasources are about 10-15). The problem is the update of the vieport that is not so fast as the received points and with more than 1000 datapoints the linegraph isn't refreshed. The same scenario works perfectly when I get datapoints every 30 ms.

I have read the discussion "Rolling window graph" about the same problem, but if I call FitToView() method when I add the new point also the Vertical Axis changes, in my three ChartPlotter I have different VerticalAxis with fixed scale.

I don't know if the replacing array of doubles is the best solution when getting data with high frequency.

Do you have some tips about the last problem?

Best regards,

Giancarlo.

Nov 13, 2009 at 6:21 PM

Hi Giancarlo,

Are you using the latest version of DynamicDataDisplay from 'Source code' page? If not, try to use that version, because in the latest changesets this bug with axes was (I hope) fixed.

 

I've created sample application with 2 gridSplitters and 3 chartPlotters, and everything worked normally. Probably the bug is in one of older versions of D3.

 

Currently there is not much difference between complete replacement of data and adding some data to it, because both of them causes complete update of the chart.

 

About "Rolling window graph": please follow the advice I've given there, and add following lines into you code:

 

// switching off approximate content bounds' comparison, as this can cause improper behavior.
plotter.Viewport.UseApproximateContentBoundsComparison = false;
// adding line chart to plotter
var line = plotter.AddLineGraph(data.AsDataSource());
// again switching off approximate content bounds' comparison - now in coercion method of Viewport2D.ContentBounds attached dependency property.
Viewport2D.SetUsesApproximateContentBoundsComparison(line, false);

Best regards,

Mikhail.

 

Nov 16, 2009 at 10:44 AM

Hi Mikhail,

many thanks for your tips, now the refresh is a little improved, (I'll wait your draft with DirectX...).

About the first problem, seems that was my problem with the reference of D3 library, now i'm sure that I'm using the latest version of D3 library, but the second problem (see image n. 2) is still present,
If you move the grid splitter all the vertical lines will appeare like second image.

Best regards,

Giancarlo.

Dec 13, 2009 at 4:28 PM

Hi Giancarlo,

this issue was probably fixed in the latest version of D3 in Source code.

Mikhail.