Inheritance diagram for NPlot::Axis:
Public Member Functions | |
virtual object | Clone () |
Deep copy of Axis. | |
Axis () | |
Default constructor. | |
Axis (double worldMin, double worldMax) | |
Constructor that takes only world min and max values. | |
Axis (Axis a) | |
Copy constructor. | |
bool | OutOfRange (double coord) |
Determines whether a world value is outside range WorldMin -> WorldMax. | |
void | LUB (Axis a) |
Sets the world extent of the current axis to be just large enough to encompas the current world extent of the axis, and the world extent of the passed in axis. | |
virtual PointF | WorldToPhysical (double coord, PointF physicalMin, PointF physicalMax, bool clip) |
World to physical coordinate transform. | |
virtual double | PhysicalToWorld (PointF p, PointF physicalMin, PointF physicalMax, bool clip) |
Return the world coordinate of the projection of the point p onto the axis. | |
object | DrawLabel (Graphics g, Point offset, Point axisPhysicalMin, Point axisPhysicalMax) |
Draw the Axis Label. | |
virtual void | DrawTick (Graphics g, double w, float size, string text, Point textOffset, Point axisPhysMin, Point axisPhysMax, out Point labelOffset, out Rectangle boundingBox) |
Draw a tick on the axis. | |
virtual void | Draw (System.Drawing.Graphics g, Point physicalMin, Point physicalMax, out Rectangle boundingBox) |
Draw the axis. | |
void | WorldTickPositions (Point physicalMin, Point physicalMax, out ArrayList largeTickPositions, out ArrayList smallTickPositions) |
Determines the positions of all Large and Small ticks. | |
void | IncreaseRange (double percent) |
Moves the world min and max values so that the world axis length is [percent] bigger. | |
Protected Member Functions | |
virtual void | DrawTicks (Graphics g, Point physicalMin, Point physicalMax, out object labelOffset, out object boundingBox) |
DrawTicks method. | |
Point | getDefaultLabelOffset (Point physicalMin, Point physicalMax) |
returns a suitable offset for the axis label in the case that there are no ticks or tick text in the way. | |
Static Protected Member Functions | |
static void | DoClone (Axis b, Axis a) |
Helper method for Clone. | |
static void | UpdateOffsetAndBounds (ref object labelOffset, ref object boundingBox, Point mergeLabelOffset, Rectangle mergeBoundingBox) |
Update the bounding box and label offset associated with an axis to encompass the additionally specified mergeBoundingBox and mergeLabelOffset respectively. | |
Properties | |
bool | TicksCrossAxis |
If true, tick marks will cross the axis, with their centre on the axis line. | |
bool | ticksCrossAxis_ = false |
virtual double | WorldMax |
Setting this raises the WorldMinChanged event and the WorldExtentsChanged event. | |
double | worldMax_ |
virtual double | WorldMin |
The minumum world extent of the axis. | |
double | worldMin_ |
int | LargeTickSize |
Length (in pixels) of a large tick. | |
int | largeTickSize_ |
int | SmallTickSize |
Length (in pixels) of the small ticks. | |
int | smallTickSize_ |
string | Label |
The Axis Label. | |
string | label_ |
bool | TickTextNextToAxis |
If true, text associated with tick marks will be drawn on the other side of the axis line [next to the axis]. | |
bool | tickTextNextToAxis_ |
bool | Hidden |
If set to true, the axis is hidden. | |
bool | hidden_ |
bool | Reversed |
If set true, the axis will behave as though the WorldMin and WorldMax values have been swapped. | |
bool | reversed_ |
bool | HideTickText |
If true, no text will be drawn next to any axis tick marks. | |
bool | hideTickText_ |
Font | TickTextFont |
This font is used for the drawing of text next to the axis tick marks. | |
Font | tickTextFont_ |
Font | tickTextFontScaled_ |
Font | LabelFont |
This font is used to draw the axis label. | |
Font | labelFont_ |
Font | labelFontScaled_ |
string | NumberFormat |
Specifies the format used for drawing tick labels. | |
string | numberFormat_ |
int | MinPhysicalLargeTickStep |
If LargeTickStep isn't specified, then this will be calculated automatically. | |
int | minPhysicalLargeTickStep_ = 30 |
System.Drawing.Color | AxisColor |
The color of the pen used to draw the ticks and the axis line. | |
System.Drawing.Pen | AxisPen |
The pen used to draw the ticks and the axis line. | |
System.Drawing.Pen | linePen_ |
bool | TicksIndependentOfPhysicalExtent |
If true, automated tick placement will be independent of the physical extent of the axis. | |
bool | ticksIndependentOfPhysicalExtent_ = false |
bool | FlipTicksLabel |
If true label is flipped about the text center line parallel to the text. | |
bool | flipTicksLabel_ = false |
float | TicksAngle |
Angle to draw ticks at (measured anti-clockwise from axis direction). | |
float | ticksAngle_ = (float)Math.PI / 2.0f |
float | TicksLabelAngle |
Angle to draw large tick labels at (clockwise from horizontal). | |
float | ticksLabelAngle_ = 0.0f |
Color | LabelColor |
The color of the brush used to draw the axis label. | |
Brush | LabelBrush |
The brush used to draw the axis label. | |
Brush | labelBrush_ |
Color | TickTextColor |
The color of the brush used to draw the axis tick labels. | |
Brush | TickTextBrush |
The brush used to draw the tick text. | |
Brush | tickTextBrush_ |
bool | AutoScaleText |
If true, label and tick text will be scaled to match size of PlotSurface2D. | |
bool | autoScaleText_ |
bool | AutoScaleTicks |
If true, tick lengths will be scaled to match size of PlotSurface2D. | |
bool | autoScaleTicks_ |
StringFormat | drawFormat_ |
double | WorldLength |
World extent of the axis. | |
internal float | FontScale |
Scale label and tick fonts by this factor. | |
float | fontScale_ |
internal float | TickScale |
Scale tick mark lengths by this factor. | |
float | tickScale_ |
virtual bool | IsLinear |
Get whether or not this axis is linear. | |
float | labelOffset_ = 0 |
float | LabelOffset |
If LabelOffsetAbsolute is false (default) then this is the offset added to default axis label position. | |
bool | labelOffsetAbsolute_ = false |
bool | LabelOffsetAbsolute |
If true, the value specified by LabelOffset is the absolute distance away from the axis that the label is drawn. | |
bool | labelOffsetScaled_ = true |
bool | LabelOffsetScaled |
Whether or not the supplied LabelOffset should be scaled by a factor as specified by FontScale. | |
Color | Color |
Set the Axis color (sets all of axis line color, Tick text color, and label color). | |
Private Member Functions | |
void | Init () |
Helper function for constructors. | |
virtual internal void | WorldTickPositions_FirstPass (Point physicalMin, Point physicalMax, out ArrayList largeTickPositions, out ArrayList smallTickPositions) |
Determines the positions, in world coordinates, of the large ticks. | |
virtual internal void | WorldTickPositions_SecondPass (Point physicalMin, Point physicalMax, ArrayList largeTickPositions, ref ArrayList smallTickPositions) |
Determines the positions, in world coordinates, of the small ticks if they have not already been generated. | |
void | UpdateScale () |
All specific axis classes derive from Axis. Axis can be used as a concrete class itself - it is an Axis without any embilishments [tick marks or tick mark labels].
This class encapsulates no physical information about where the axes are drawn.
Definition at line 68 of file Axis.cs.
|
Default constructor.
|
|
Constructor that takes only world min and max values.
|
|
Copy constructor.
|
|
Deep copy of Axis. This method includes a check that guards against derived classes forgetting to implement their own Clone method. If Clone is called on a object derived from Axis, and the Clone method hasn't been overridden by that object, then the test this.GetType == typeof(Axis) will fail.
Reimplemented in NPlot::DateTimeAxis, NPlot::LabelAxis, NPlot::LinearAxis, NPlot::LogAxis, and NPlot::PiAxis. Definition at line 563 of file Axis.cs. Referenced by NPlot::PlotSurface2D::DetermineAxesToDraw(). |
|
Helper method for Clone. Does all the copying - can be called by derived types so they don't need to implement this part of the copying themselves. also useful in constructor of derived types that takes Axis class. Definition at line 583 of file Axis.cs. References autoScaleText_, autoScaleTicks_, FontScale, hidden_, hideTickText_, label_, labelBrush_, labelFont_, labelOffset_, labelOffsetAbsolute_, labelOffsetScaled_, largeTickSize_, linePen_, minPhysicalLargeTickStep_, numberFormat_, reversed_, smallTickSize_, ticksAngle_, TickScale, ticksCrossAxis_, ticksIndependentOfPhysicalExtent_, ticksLabelAngle_, tickTextBrush_, tickTextFont_, tickTextNextToAxis_, worldMax_, and worldMin_. |
|
Draw the axis. This involves three steps: (1) Draw the axis line. (2) Draw the tick marks. (3) Draw the label.
Definition at line 1257 of file Axis.cs. Referenced by NPlot::PointPlot::DrawInLegend(). |
|
Draw the Axis Label.
|
|
Draw a tick on the axis.
|
|
DrawTicks method. In base axis class this does nothing.
Reimplemented in NPlot::DateTimeAxis, NPlot::LabelAxis, NPlot::LinearAxis, NPlot::LogAxis, and NPlot::PiAxis. |
|
returns a suitable offset for the axis label in the case that there are no ticks or tick text in the way.
|
|
Moves the world min and max values so that the world axis length is [percent] bigger. If the current world max and min values are the same, they are moved appart an arbitrary amount. This arbitrary amount is currently 0.01, and will probably be configurable in the future.
Definition at line 1447 of file Axis.cs. Referenced by NPlot::SequenceAdapter::SuggestYAxis(), NPlot::HistogramPlot::SuggestYAxis(), and NPlot::CandlePlot::CandleDataAdapter::SuggestYAxis(). |
|
Helper function for constructors. Do initialization here so that Clear() method is handled properly Reimplemented in NPlot::DateTimeAxis, NPlot::LabelAxis, NPlot::LinearAxis, NPlot::LogAxis, and NPlot::PiAxis. |
|
Sets the world extent of the current axis to be just large enough to encompas the current world extent of the axis, and the world extent of the passed in axis.
|
|
Determines whether a world value is outside range WorldMin -> WorldMax.
|
|
Return the world coordinate of the projection of the point p onto the axis.
Reimplemented in NPlot::LogAxis. |
|
Update the bounding box and label offset associated with an axis to encompass the additionally specified mergeBoundingBox and mergeLabelOffset respectively.
|
|
|
|
Determines the positions of all Large and Small ticks.
|
|
Determines the positions, in world coordinates, of the large ticks. When the physical extent of the axis is small, some of the positions that were generated in this pass may be converted to small tick positions and returned as well. This default implementation returns empty large ticks list and null small tick list.
Reimplemented in NPlot::DateTimeAxis, NPlot::LabelAxis, NPlot::LinearAxis, NPlot::LogAxis, and NPlot::PiAxis. Definition at line 1385 of file Axis.cs. Referenced by NPlot::Grid::Draw(). |
|
Determines the positions, in world coordinates, of the small ticks if they have not already been generated. This default implementation creates an empty smallTickPositions list if it doesn't already exist.
Reimplemented in NPlot::DateTimeAxis, NPlot::LinearAxis, and NPlot::LogAxis. Definition at line 1408 of file Axis.cs. Referenced by NPlot::Grid::Draw(). |
|
World to physical coordinate transform.
Reimplemented in NPlot::LogAxis. |
|
If true, label and tick text will be scaled to match size of PlotSurface2D. If false, they won't be. Could also be argued this belongs in PlotSurface2D |
|
Definition at line 531 of file Axis.cs. Referenced by DoClone(). |
|
If true, tick lengths will be scaled to match size of PlotSurface2D. If false, they won't be. Could also be argued this belongs in PlotSurface2D |
|
Definition at line 550 of file Axis.cs. Referenced by DoClone(). |
|
The color of the pen used to draw the ticks and the axis line.
|
|
The pen used to draw the ticks and the axis line.
|
|
Set the Axis color (sets all of axis line color, Tick text color, and label color).
|
|
|
|
If true label is flipped about the text center line parallel to the text.
|
|
|
|
Scale label and tick fonts by this factor. Set by PlotSurface2D Draw method. Definition at line 1472 of file Axis.cs. Referenced by DoClone(). |
|
|
|
If set to true, the axis is hidden. That is, the axis line, ticks, tick labels and axis label will not be drawn. |
|
Definition at line 233 of file Axis.cs. Referenced by DoClone(). |
|
If true, no text will be drawn next to any axis tick marks.
|
|
Definition at line 268 of file Axis.cs. Referenced by DoClone(). |
|
Get whether or not this axis is linear.
Reimplemented in NPlot::LogAxis. |
|
The Axis Label.
|
|
Definition at line 196 of file Axis.cs. Referenced by DoClone(). |
|
The brush used to draw the axis label.
|
|
Definition at line 483 of file Axis.cs. Referenced by DoClone(). |
|
The color of the brush used to draw the axis label.
|
|
This font is used to draw the axis label.
|
|
Definition at line 305 of file Axis.cs. Referenced by DoClone(). |
|
|
|
If LabelOffsetAbsolute is false (default) then this is the offset added to default axis label position. If LabelOffsetAbsolute is true, then this is the absolute offset of the label from the axis. If positive, offset is further away from axis, if negative, towards the axis. |
|
Definition at line 1526 of file Axis.cs. Referenced by DoClone(). |
|
If true, the value specified by LabelOffset is the absolute distance away from the axis that the label is drawn. If false, the value specified by LabelOffset is added to the pre-calculated value to determine the axis label position. |
|
Definition at line 1547 of file Axis.cs. Referenced by DoClone(). |
|
Whether or not the supplied LabelOffset should be scaled by a factor as specified by FontScale.
|
|
Definition at line 1567 of file Axis.cs. Referenced by DoClone(). |
|
Length (in pixels) of a large tick. Not the distance between large ticks. The length of the tick itself. |
|
Definition at line 162 of file Axis.cs. Referenced by DoClone(). |
|
Definition at line 377 of file Axis.cs. Referenced by DoClone(). |
|
If LargeTickStep isn't specified, then this will be calculated automatically. The calculated value will not be less than this amount. |
|
Definition at line 344 of file Axis.cs. Referenced by DoClone(). |
|
Specifies the format used for drawing tick labels. See StringBuilder.AppendFormat for a description of this string. |
|
Definition at line 325 of file Axis.cs. Referenced by DoClone(). |
|
If set true, the axis will behave as though the WorldMin and WorldMax values have been swapped.
|
|
Definition at line 251 of file Axis.cs. Referenced by DoClone(). |
|
Length (in pixels) of the small ticks.
|
|
Definition at line 179 of file Axis.cs. Referenced by DoClone(). |
|
Angle to draw ticks at (measured anti-clockwise from axis direction).
Definition at line 426 of file Axis.cs. Referenced by NPlot::PlotSurface2D::UpdateAxes(). |
|
Definition at line 436 of file Axis.cs. Referenced by DoClone(). |
|
Scale tick mark lengths by this factor. Set by PlotSurface2D Draw method. Definition at line 1492 of file Axis.cs. Referenced by DoClone(). |
|
|
|
If true, tick marks will cross the axis, with their centre on the axis line. If false, tick marks will be drawn as a line with origin starting on the axis line. |
|
Definition at line 86 of file Axis.cs. Referenced by DoClone(). |
|
If true, automated tick placement will be independent of the physical extent of the axis. Tick placement will look good for charts of typical size (say physical dimensions of 640x480). If you want to produce the same chart on two graphics surfaces of different sizes [eg Windows.Forms control and printer], then you will want to set this property to true. If false [default], the number of ticks and their placement will be optimally calculated to look the best for the given axis extent. This is very useful if you are creating a cart with particularly small or large physical dimensions. |
|
Definition at line 402 of file Axis.cs. Referenced by DoClone(). |
|
Angle to draw large tick labels at (clockwise from horizontal). Note: this is currently only implemented well for the lower x-axis. |
|
Definition at line 454 of file Axis.cs. Referenced by DoClone(). |
|
The brush used to draw the tick text.
|
|
Definition at line 512 of file Axis.cs. Referenced by DoClone(). |
|
The color of the brush used to draw the axis tick labels.
|
|
This font is used for the drawing of text next to the axis tick marks.
|
|
Definition at line 286 of file Axis.cs. Referenced by DoClone(). |
|
|
|
If true, text associated with tick marks will be drawn on the other side of the axis line [next to the axis]. If false, tick mark text will be drawn at the end of the tick mark [on the same of the axis line as the tick]. |
|
Definition at line 215 of file Axis.cs. Referenced by DoClone(). |
|
World extent of the axis.
Definition at line 1365 of file Axis.cs. Referenced by NPlot::AxesConstraint::YPixelWorldLength::ApplyConstraint(), and NPlot::AxesConstraint::XPixelWorldLength::ApplyConstraint(). |
|
Setting this raises the WorldMinChanged event and the WorldExtentsChanged event.
Reimplemented in NPlot::LogAxis. Definition at line 99 of file Axis.cs. Referenced by NPlot::AxesConstraint::AspectRatio::ApplyConstraint(), NPlot::Windows::PlotSurface2D::CopyDataToClipboard(), NPlot::ImagePlot::Draw(), NPlot::FilledRegion::Draw(), NPlot::ArrowItem::Draw(), LUB(), NPlot::PageAlignedPhysicalAxis::PageAlignedPhysicalAxis(), NPlot::StepPlot::SuggestXAxis(), and NPlot::HistogramPlot::SuggestXAxis(). |
|
|
|
The minumum world extent of the axis. Note that it is sensical if WorldMax is less than WorldMin - the axis would just be descending not ascending. Currently Axes won't display properly if you do this - use the Axis.Reversed property instead to achieve the same result. Setting this raises the WorldMinChanged event and the WorldExtentsChanged event. Reimplemented in NPlot::LogAxis. Definition at line 128 of file Axis.cs. Referenced by NPlot::AxesConstraint::AspectRatio::ApplyConstraint(), NPlot::Windows::PlotSurface2D::CopyDataToClipboard(), NPlot::PointPlot::Draw(), NPlot::ImagePlot::Draw(), NPlot::FilledRegion::Draw(), NPlot::ArrowItem::Draw(), LUB(), NPlot::PageAlignedPhysicalAxis::PageAlignedPhysicalAxis(), NPlot::StepPlot::SuggestXAxis(), and NPlot::HistogramPlot::SuggestXAxis(). |
|
|