12-19-2015 11:46 PM
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.
12-21-2015 10:45 AM
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 );
.