[vtkusers] vtkChartXY
Hagen Mölle
h.moelle at googlemail.com
Tue Oct 19 02:04:20 EDT 2010
Hi Marcus,
first of all: the new chart API is a great piece of work.
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).
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.
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.
I can help programming the stuff if you give me some details about the
vtkChartXY class.
Thanks,
Hagen
> 2010/10/18 Hagen Mölle<h.moelle at googlemail.com>:
>> Hi,
>>
>> I am playing around with vtkChartXY / vtkPlot API. I experienced the
>> following two problems.
>>
>> 1. Adding plots to a chart works fine. But one have to use a vtkTable object
>> as input for multiple number of vtkPlot objects. This requires to have plots
>> with the same number of points. So my first problem is to display plots with
>> different number of points. Is this possible?
> You could use different tables - each plot can have columns that do
> not necessarily belong to the same table. I could probably add some
> further API to take other data types, the main limitation is that x
> and y must have the same number of rows, but each vtkPlot can have a
> different table and columns in that table. I should write an example
> to demonstrate this approach.
>> 2. Is there a way to rotate the label of the y-axis? Right now the label is
>> horizontal. This causes the label not being displayed correctly. It reaches
>> over the border of the chart.
>>
> Funny you should ask. I have just merged in a topic branch that
> accomplishes this very goal for FreeType. It has been a longer running
> piece of work to improve the FreeType rendering capabilities. If you
> pull the latest VTK master you should see the changes after a rebuild.
>
> Thanks,
>
> Marcus
More information about the vtkusers
mailing list