[vtkusers] Displaying plot legends in Charts

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri Apr 22 08:51:46 EDT 2011


On Wed, Apr 20, 2011 at 6:10 PM, Jenya Burstein <taijinian at gmail.com> wrote:
> Hello,
>
> We need to be able to:
> 1) Display plot legends that can be interactively moved. It appears that
> vtkChart's legend doesn't not allow legend to be repositioned interactively.
> Is that correct?

This feature has not yet been added, it would be possible to add it.
There is support for positioning the legend relative to its chart.

> 2) Display plot legends only for some plots of a chart. There doesn't seem
> to be an easy way to specify whether a legend should be drawn for a plot of
> a chart. Looking at VTK code, it appears that if the Labels member of the
> vtkPlot class is set to null, VTK will create and use AutoLabels. The only
> way I can think of making a plot to be skipped for drawing a legend is to
> subclass the vtkPlot[Line] and override the GetLabels() method to return
> null. Is that the intended way?

This is something I would like to add in. As always, I would gladly
accept patches, and some of this may get added as part of some work I
am doing. I can't give definite timeframes on when though I am afraid.
>
> Any info is much appreciated,

Hopefully this clears things up. I think both features should go in,
but neither is currently implemented.

Thanks,

Marcus



More information about the vtkusers mailing list