Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get X- and Y-axes in my CWGraph?

Hi, I am programming with Measurement Studio for Visual C++. In order to get nice graphs on paper, I use classic style 2D CWGraphs with:
line color: black,
caption color: black,
plot area color: white,
graph frame color: white,
background color: white.
CWGraph plots the tickmarks of the Y- and X- axes, a grey line at the left, a grey line at the top, but no X-axis and no line at the right (in fact no black Y-axis too). This is because the standard �frame-lines� of a CWGraph are always grey on the left and at the top, and white on the right and at the bottom. Of course, the latter ones are not visible on a white background. Question: how do I get black X- and Y- axis, black �frame-lines� at the top and on the right and
how can I manipulate the width of these lines.
Thanks,
Hugo van Steenis
ErasmusMC Rotterdam
0 Kudos
Message 1 of 2
(2,951 Views)
Unfortunately, the graph does not currently provide a way to configure the color, width, or style of the plot area border. This won't look perfect since there's nothing you can do about the grey lines, but one workaround would be to add a plot to the graph and plot a line around the border of the graph to simulate what you want to do. Maybe something like this:

CNiPlot plot = m_graph.Plots.Add();
plot.LineWidth = 3;
plot.LineColor = CNiColor(0, 0, 0);

CNiAxis xAxis = plot.XAxis, yAxis = plot.YAxis;
CNiReal64Vector xData(5), yData(5);

xData[0] = xAxis.Minimum;
yData[0] = yAxis.Minimum;
xData[1] = xAxis.Maximum;
yData[1] = yAxis.Minimum;
xData[2] = xAxis.Maximum;
yData[2] = yAxis.Maximum;
xData[3] =
xAxis.Minimum;
yData[3] = yAxis.Maximum;
xData[4] = xAxis.Minimum;
yData[4] = yAxis.Minimum;

plot.PlotXvsY(xData, yData);

- Elton
0 Kudos
Message 2 of 2
(2,951 Views)