Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get plot area coords from a CNiGraph control?

I want to overlay another control on top of my CNiGraph control,
so that it is the same width as the plot area window.
This is all well and good. When I draw my controls up at design time
everything lines up nicely.
However later on when its running, a Y-axis label on my graph changes,
which causes the width of the plot area to change, thus putting my
overlaid control out of alignment.
Is there any way to get the width of the plot area of the control, either
as absolute coords or as relative coords or any way of getting the width
of the labels?

TIA

Paul
0 Kudos
Message 1 of 3
(3,313 Views)
Unfortunately, this is not possible with CNiGraph. One way that you can work around this is to explicitly set the width of the label. You can do this via the Width drop-down in the Format tab of the graph's property pages. This will keep the width of the label constant, and hence will keep the width of the plot area constant. For more info, see the documentation for CNiLabels::Width in the Measurement Studio reference.

- Elton
0 Kudos
Message 2 of 3
(3,305 Views)
Unfortunately I can't use fixed length lables. I have thought of one possible way around
it via getting the Picture properties for the "Plot Area" CNiImage.

I can set an image to cover the plot area quite easily, via SetUrl, but I want to reload
the default image again, how can I do this? I have tried a couple of things, but I can seem
to get it to reset to the proper default image.

Any ideas?

Paul
0 Kudos
Message 3 of 3
(3,301 Views)