Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting multiple line graphs with legend

Hello again,

As time flies, I would like to implement another "feature" which is the following:

Usually the data for one graph consists of X and Y values, whereas the values for X are increased to a defined point and then decreased again, so the graph would show something like a "hysteresis".

I would like to display the "direction" of each single plotted XY-Graph, so that one can see where the start and the end of a graph is located. I have different ideas on that but am not sure how to realize it.

One would be to display different PointShapes within one single graph (one for rising, one for falling X-values), but I am not sure, if there is a way without "splitting" the graph in two and give each one of them a different PointShape. I think this could get a little messy, as I would like to display just one element in the legend.

Another idea would be to display arrow symbols on the line between two single points, but I have totally no idea how I could realize this.

I hope this is understandable...

Thanks so much

 

0 Kudos
Message 11 of 13
(868 Views)

I have attached a custom renderer that implements your first suggestion, using different point styles to mark the "increasing" and "decreasing" areas of plot X-values. You can incorporate it into the previous example by including an instance in the PlotRendererGroup in the MainWindow.xaml.cs file:

 

    var hysterisisRenderer = new HysteresisRenderer {
        IncreasingRenderer = new PointPlotRenderer { Shape = PointShape.OutwardTriangle },
        DecreasingRenderer = new PointPlotRenderer { Shape = PointShape.InwardTriangle }
    };

    //...

    renderer = new PlotRendererGroup { PlotRenderers = { new CustomRenderer( ), lineRenderer, hysterisisRenderer } };

 


Displaying a symbol on the connecting lines would also be possible, but would more custom code to calculate the correct position and create a PointShape to draw the arrow at the appropriate angle.

~ Paul H
Message 12 of 13
(863 Views)

As before, this is exactly what I needed, thank you so much for this Paul!

0 Kudos
Message 13 of 13
(851 Views)