[vtkusers] Set the Color of each line in vtkChartParallelCoordinates

Jon Payne jpayne at hgl-dynamics.com
Tue Nov 22 07:21:26 EST 2011


On 21/11/2011 19:35, Matthias Eggert wrote:
>
> Hi,
>
> I tried your solutions, but I think I still don't get it. When I try:
>    vtkSmartPointer<vtkLookupTable>  lookupTable =
> vtkSmartPointer<vtkLookupTable>::New();
>    lookupTable->SetTableRange(0.0, 10.0);
>    lookupTable->Build();
>
>    vtkPlotPoints* tmp = vtkPlotPoints::SafeDownCast(chart);
>    tmp->SetLookupTable(lookupTable);
>    tmp->SelectColorArray("Category_ids");
>
> I just get a Run-Time exception. You don't have any c++ example do you?
>
> Furthermore, a little different from the original topic, how do I access the
> lines, that have been selected? I just don't get it. Sorry for my stupidity^^
>
> Kind regards,
> Matthias
>
>
Hi Matthias,

You cannot downcast a chart to a plotplots; they are two different types.

You need to add the points to the chart, and then cast the PlotPlot e.g.

  vtkPlotPoints *tmp = vtkPlotPoints::SafeDownCast( 
chart->AddPlot(vtkChart::POINTS) );

Hope that helps,
Jon



More information about the vtkusers mailing list