[vtkusers] vtkChartXY

Marcus D. Hanwell marcus.hanwell at kitware.com
Wed Oct 20 09:43:47 EDT 2010


2010/10/19 Hagen Mölle <h.moelle at googlemail.com>:
>  Hi Marcus,
>
> first of all: the new chart API is a great piece of work.

Thank you.
>
> 1. Creating an additional table for every plot was my first idea. I see the
> advantages for using a table too. You do not need to check length of input
> arrays. Otherwise one has to create additional tables for nothing if number
> of data points varies in each plot. In my opinion it would be really nice
> having a method like vtkPlot::SetInput(vtkDataSet*, vtkDataSet*) or
> vtkPlot::SetInput(vtkDataSet*, vtkDataSet*, int iNumPoints).

I have considered inputs like this, the vtkTable is fairly lightweight
though. I standardized on vtkTable quite early on, but never ruled out
taking other types as input. It just has not been a priority.
>
> 2. I will try it right now.
>
> I would like to discuss two further points.
>
> 3. Removing a plot from a chart works with an index. Would it be possible to
> use (unique) identifiers (just a number). Lets imagine a vtkPlot object
> holds an identifier and vtkChartXY::RemovePlot(int iIdentifier) will remove
> this plot object. Assume you have a large number of plots and you would like
> to display only a few of them. Right now I would have to manage the indices
> of the shown plots and map them to a list of available plots. Furthermore
> assume one plot gets deleted from/added to the list of available plots...
> Working with identifiers would make it a lot easier.

As Eric pointed out, you can use the pointer and this is a unique ID
for any plot object. You might also consider simply setting the plot
visibility - this is what we do in ParaView when making plots
visible/invisible. When a plot is not visible it will not affect the
range, will not be displayed in the legend etc.
>
> 4. The automatically generated tic labels are really nice. I propose a
> different label scheme for logarithmic plots. Right now the tic labels are
> generated evenly spaced between 1 to 10, 10 to 100 ... This results in
> strange tic values like 15.8489. Would it be possible to generate tic values
> like 1 2 3 4 5 6 7 8 9 10 20 30 40 50 ... The numbers from 5-9, 50-90 are
> common to overlap so I would not show them. For convenience I would show the
> tic marks only.
>
Agreed, this has been on my list of things to get to for a while. I
would love to get this feature in.

> I can help programming the stuff if you give me some details about the
> vtkChartXY class.
>
You would want to look at vtkAxis, and as Eric pointed out the latest
code is all in our Git repository. Once you have some code you could
upload it to Gerrit for review (more to come about this), and I would
be happy to work on integrating it with you.

Thanks,

Marcus



More information about the vtkusers mailing list