[vtkusers] vtkChartXY without any plot

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri Feb 25 13:23:38 EST 2011


]On Fri, Feb 25, 2011 at 11:39 AM, nclemeur <nclemeur at gmail.com> wrote:
>
> Hello,
>
> It seems that when a vtkChartXY is created without adding any plot, nothing
> is shown (axes, grid,...). Simirlarly, if all the plots are removed the
> chart just disappear. Is that by design or I am missing something? I would
> like to keep the chart displayed, even if it is empty... I can probably
> workaround by always having a dummy plot that has the same color as the
> background, but this does not feel right (and would introduce some
> complications for the legend, mouse tooltip,...).
>
> Any tip on achieving this?
>
It was the preferred behavior specified as I wrote the implementation.
There is a check in the Paint function that checks for visible plots,
and returns early if there are none. This could be turned into a flag,
for the code available now you could simply add an empty plot that is
visible to (no data) and I think that should work.

Marcus



More information about the vtkusers mailing list