Go to the documentation of this file.
37 #include "vtkChartsCoreModule.h"
47 class vtkChartXYPrivate;
142 int GetPlotCorner(
vtkPlot* plot);
147 void SetPlotCorner(
vtkPlot* plot,
int corner);
206 void RemovePlotSelections();
212 vtkSetMacro(DrawAxesAtOrigin,
bool);
213 vtkGetMacro(DrawAxesAtOrigin,
bool);
214 vtkBooleanMacro(DrawAxesAtOrigin,
bool);
222 vtkSetMacro(AutoAxes,
bool);
223 vtkGetMacro(AutoAxes,
bool);
224 vtkBooleanMacro(AutoAxes,
bool);
231 vtkSetMacro(HiddenAxisBorder,
int);
232 vtkGetMacro(HiddenAxisBorder,
int);
241 vtkSetMacro(ForceAxesToBounds,
bool);
242 vtkGetMacro(ForceAxesToBounds,
bool);
243 vtkBooleanMacro(ForceAxesToBounds,
bool);
254 vtkSetMacro(BarWidthFraction,
float);
255 vtkGetMacro(BarWidthFraction,
float);
265 vtkSetMacro(ZoomWithMouseWheel,
bool);
266 vtkGetMacro(ZoomWithMouseWheel,
bool);
267 vtkBooleanMacro(ZoomWithMouseWheel,
bool);
276 vtkSetMacro(AdjustLowerBoundForLogPlot,
bool);
277 vtkGetMacro(AdjustLowerBoundForLogPlot,
bool);
278 vtkBooleanMacro(AdjustLowerBoundForLogPlot,
bool);
287 vtkSetMacro(DragPointAlongX,
bool);
288 vtkGetMacro(DragPointAlongX,
bool);
289 vtkBooleanMacro(DragPointAlongX,
bool);
298 vtkSetMacro(DragPointAlongY,
bool);
299 vtkGetMacro(DragPointAlongY,
bool);
300 vtkBooleanMacro(DragPointAlongY,
bool);
356 void RecalculatePlotTransforms();
362 void RecalculatePlotBounds();
376 virtual int GetLegendBorder(
vtkContext2D* painter,
int axisPosition);
382 virtual void SetLegendPosition(
const vtkRectf& rect);
477 vtkChartXYPrivate* ChartPrivate;
488 void CalculateBarPlots();
503 bool RemovePlotFromCorners(
vtkPlot* plot);
511 void ReleasePlotSelections();
516 void TransformBoxOrPolygon(
bool polygonMode,
vtkTransform2D* transform,
536 #endif // vtkChartXY_h
Factory class for drawing 2D charts.
virtual vtkIdType GetNumberOfPlots()
Get the number of plots the chart contains.
vtkRectf MouseBox
The box created as the mouse is dragged around the screen.
data structure to represent mouse events.
virtual bool RemovePlot(vtkIdType index)
Remove the plot at the specified index, returns true if successful, false if the index was invalid.
data structure to represent key events.
virtual void SetSelectionMethod(int method)
Set the selection method, which controls how selections are handled by the chart.
vtkSmartPointer< vtkChartLegend > Legend
The legend for the chart.
Small struct used by InvokeEvent to send some information about the point that was clicked on.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
virtual bool KeyPressEvent(const vtkContextKeyEvent &key)
Key press event.
vtkSmartPointer< vtkTooltipItem > Tooltip
The tooltip item for the chart - can be used to display extra information.
Class for drawing 2D primitives to a graphical context.
virtual void SetAxis(int axisIndex, vtkAxis *)
Set the axis specified by axisIndex.
virtual vtkPlot * AddPlot(int type)
Add a plot to the chart, defaults to using the name of the y column.
bool DragPointAlongX
Properties to enable the drag of a point for the ClickAndDrag Action.
Abstract class for 2D plots.
bool AutoAxes
Should axes be turned on and off automatically - defaults to on.
float BarWidthFraction
The fraction of the interval taken up along the x axis by any bars that are drawn on the chart.
bool DrawNearestPoint
Should we draw the location of the nearest point on the plot?
bool ZoomWithMouseWheel
Property to enable zooming the chart with the mouse wheel.
bool Paint(vtkContext2D *painter) override=0
Paint event for the chart, called whenever the chart needs to be drawn.
bool DrawAxesAtOrigin
Keep the axes drawn at the origin? This will attempt to keep the axes drawn at the origin,...
virtual vtkChartLegend * GetLegend()
Get the legend for the chart, if available.
takes care of drawing the plot grid
bool AdjustLowerBoundForLogPlot
Property to adjust the minimum of a logarithmic axis to be greater than 0, regardless of the minimum ...
bool ForceAxesToBounds
Property to force the axes to have their Minimum and Maximum properties inside the plot boundaries.
a simple class to control print indentation
bool PlotTransformValid
Does the plot area transform need to be recalculated?
virtual bool Hit(const vtkContextMouseEvent &mouse)
Return true if the supplied x, y coordinate is inside the item.
virtual vtkPlot * GetPlot(vtkIdType index)
Get the plot at the specified index, returns null if the index is invalid.
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
vtkVector2i ScreenPosition
int HiddenAxisBorder
Size of the border when an axis is hidden.
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
Mouse button release event.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
takes care of drawing 2D axes
virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse)
Mouse enter event.
virtual void ClearPlots()
Remove all plots from the chart.
vtkContextPolygon SelectionPolygon
The polygon created as the mouse is dragged around the screen when in polygonal selection mode.
virtual void RecalculateBounds()
Request that the chart recalculates the range of its axes.
virtual vtkIdType GetNumberOfAxes()
Get the number of axes in the current chart.
virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse)
Mouse leave event.
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
Mouse button down event Return true if the item holds the event, false if the event can be propagated...
Some derived classes for the different vectors commonly used.
Factory class for drawing XY charts.
Wrapper around std::string to keep symbols short.
bool DrawSelectionPolygon
Should the selection polygon be drawn.
bool DrawBox
Should the box be drawn (could be selection, zoom etc).
virtual vtkAxis * GetAxis(int axisIndex)
Get the axis specified by axisIndex.
virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta)
Mouse wheel event, positive delta indicates forward movement of the wheel.
virtual void SetShowLegend(bool visible)
Set/get whether the chart should draw a legend.
virtual void Update()
Perform any updates to the item that may be necessary before rendering.