Skip to content
Snippets Groups Projects
Commit 65579200 authored by Kyle Lutz's avatar Kyle Lutz
Browse files

Add vtkChartXY::SetTooltip() method

This adds a new method to the vtkChartXY class which
allows for the default vtkTooltipItem for the chart to
be changed.

Change-Id: If831a73b88ef12db0a6be24200624cbe0ffa1170
parent 285259b6
No related branches found
No related tags found
No related merge requests found
......@@ -1077,6 +1077,30 @@ vtkChartLegend* vtkChartXY::GetLegend()
return this->Legend;
}
//-----------------------------------------------------------------------------
void vtkChartXY::SetTooltip(vtkTooltipItem *tooltip)
{
if(tooltip == this->Tooltip)
{
// nothing to change
return;
}
if(this->Tooltip)
{
// remove current tooltip from scene
this->RemoveItem(this->Tooltip);
}
this->Tooltip = tooltip;
if(this->Tooltip)
{
// add new tooltip to scene
this->AddItem(this->Tooltip);
}
}
//-----------------------------------------------------------------------------
vtkTooltipItem* vtkChartXY::GetTooltip()
{
......
......@@ -102,6 +102,10 @@ public:
// Get the vtkChartLegend object that will be displayed by the chart.
virtual vtkChartLegend* GetLegend();
// Description:
// Set the vtkTooltipItem object that will be displayed by the chart.
virtual void SetTooltip(vtkTooltipItem *tooltip);
// Description:
// Get the vtkTooltipItem object that will be displayed by the chart.
virtual vtkTooltipItem* GetTooltip();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment