[vtkusers] vtkChartXY

Hagen Mölle h.moelle at googlemail.com
Thu Oct 21 03:09:52 EDT 2010


On 10/20/2010 03:43 PM, Marcus D. Hanwell wrote:
> 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
Hi Marcus,

can you explain me the difference between automatic and fixed axis 
behaviour? The only difference I see is when resizing the window the tic 
marks get recalculated in automatic mode and are unchanged in fixed mode.

Another thing I figured out is SetNumberOfTicks is neither working in 
automatic nor in fixed mode. For my understanding this is ok for 
automatic mode. It should work in fixed mode.

Now I will have a deeper look into the vtkChart classes. After that I 
will propose an implementation for new logarithmic label scheme. So we 
can discuss about it.

Hagen




More information about the vtkusers mailing list