Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

one graph with multiple bar plots

Hi all, I have a question about plotting multiple barchart plots in one graph. Currently my code is

 

<ni:Graph.Plots>
                    <ni:Plot Label="Up Time">
                        <ni:BarPlotRenderer Stroke="#7FFF0000" Fill="#7FFF0000" StrokeThickness="2" BarWidth="0.8"/>
                    </ni:Plot>
                    <ni:Plot Label="Down Time" >
                        <ni:BarPlotRenderer Stroke="#7FFFFF00" Fill="#7FFFFF00" StrokeThickness="2" BarWidth="0.4"/>
                    </ni:Plot>
                </ni:Graph.Plots>

However. these two bar plots overlap with each other for the same index in X axis. What I what to have is that for the same index in X axis, two bars stand side by side, rather than overlap with each other. Can any one give any instructions how to get it? Thank you.

 

0 Kudos
Message 1 of 2
(3,928 Views)

The Measurement Studio graphs do not currently support "business-style" side-by-side bar charts. You could define a custom renderer to draw bars differently, but a simpler solution may be to adjust the data that the bar renderer uses.


I have attached a custom RangeScaleKind that supports two side-by-side bar plots by shifting the index data each plot draws against. Assign it to the horizontal axis with a reference to your graph: xAxis.ScaleKind = new BarShiftScaleKind( graph );.

~ Paul H
0 Kudos
Message 2 of 2
(3,898 Views)