[vtkusers] Displaying plot legends in Charts

Jenya Burstein taijinian at gmail.com
Fri Apr 22 10:52:20 EDT 2011


Marcus,

Thank you for the response.

Which path would be easier?
  - Add the interactivity behavior for vtkCharLegend;
  - Create a vtk widget for
vtkLegendBoxActor<http://www.vtk.org/doc/nightly/html/classvtkLegendBoxActor.html>

Another potential feature, that I am thinking ahead, is the ability to
display multiple legends. For example, one legend box for colors and another
separate box for symbol shapes. As far as I can tell, vtkChart, currently,
doesn't support multiple legends. If it is possible to place a
vtkLegendBoxActor into a vtkContextView, the multiple legend box feature
would become instantly available.

Jenya

On Fri, Apr 22, 2011 at 5:51 AM, Marcus D. Hanwell <
marcus.hanwell at kitware.com> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110422/3b335c34/attachment.htm>


More information about the vtkusers mailing list