//============================================================================
//ZedGraph Class Library - A Flexible Line Graph/Bar Graph Library in C#
//Copyright ?2004 John Champion
//
//This library is free software; you can redistribute it and/or
//modify it under the terms of the GNU Lesser General Public
//License as published by the Free Software Foundation; either
//version 2.1 of the License, or (at your option) any later version.
//
//This library is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
//Lesser General Public License for more details.
//
//You should have received a copy of the GNU Lesser General Public
//License along with this library; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//=============================================================================
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace DrawGraph
{
///
/// Enumeration type for the various axis types that are available
///
///
public enum AxisType
{
/// An ordinary, cartesian axis
Linear,
/// A base 10 log axis
Log,
/// A cartesian axis with calendar dates or times
Date,
/// An ordinal axis with user-defined text labels. An ordinal axis means that
/// all data points are evenly spaced at integral values, and the actual coordinate values
/// for points corresponding to that axis are ignored. That is, if the X axis is an
/// ordinal type, then all X values associated with the curves are ignored.
///
///
///
Text,
/// An ordinal axis with regular numeric labels. An ordinal axis means that
/// all data points are evenly spaced at integral values, and the actual coordinate values
/// for points corresponding to that axis are ignored. That is, if the X axis is an
/// ordinal type, then all X values associated with the curves are ignored.
///
///
Ordinal,
/// An ordinal axis that will have labels formatted with ordinal values corresponding
/// to the number of values in each .
///
///
/// The data points will be evenly-spaced at ordinal locations, and the
/// actual data values are ignored.
///
///
DateAsOrdinal,
/// An ordinal axis that will have labels formatted with values from the actual data
/// values of the first in the .
///
///
/// Although the tics are labeled with real data values, the actual points will be
/// evenly-spaced in spite of the data values. For example, if the X values of the first curve
/// are 1, 5, and 100, then the tic labels will show 1, 5, and 100, but they will be equal
/// distance from each other.
///
///
LinearAsOrdinal,
/// An exponential axis
Exponent
}
///
/// Enumeration type for the various types of fills that can be used with
/// charts.
///
public enum FillType
{
/// No fill
None,
/// A solid fill using
Solid,
/// A custom fill using either or
///
Brush,
///
/// Fill with a single solid color based on the X value of the data.
/// The X value is
/// used to determine the color value based on a gradient brush, and using a data range
/// of and . You can create a multicolor
/// range by initializing the class with your own custom
/// object based on a . In cases where a
/// data value makes no sense (, ,
/// etc.), a default value of 50% of the range is assumed. The default range is 0 to 1.
///
///
///
///
GradientByX,
///
/// Fill with a single solid color based on the Z value of the data.
/// The Z value is
/// used to determine the color value based on a gradient brush, and using a data range
/// of and . You can create a multicolor
/// range by initializing the class with your own custom
/// object based on a . In cases where a
/// data value makes no sense (, ,
/// etc.), a default value of 50% of the range is assumed. The default range is 0 to 1.
///
///
///
///
GradientByY,
///
/// Fill with a single solid color based on the Z value of the data.
/// The Z value is
/// used to determine the color value based on a gradient brush, and using a data range
/// of and . You can create a multicolor
/// range by initializing the class with your own custom
/// object based on a . In cases where a
/// data value makes no sense (, ,
/// etc.), a default value of 50% of the range is assumed. The default range is 0 to 1.
///
///
///
///
GradientByZ,
///
/// Fill with a single solid color based on the "ColorValue" property of the data.
/// The "ColorValue" property is
/// used to determine the color value based on a gradient brush, and using a data range
/// of and . You can create a multicolor
/// range by initializing the class with your own custom
/// object based on a . In cases where a
/// data value makes no sense (, ,
/// etc.), a default value of 50% of the range is assumed. The default range is 0 to 1.
///
///
///
///
GradientByColorValue
}
///
/// Enumeration type for the various axis date and time unit types that are available
///
public enum DateUnit
{
/// Yearly units and
///
Year,
/// Monthly units and
///
Month,
/// Daily units and
///
Day,
/// Hourly units and
///
Hour,
/// Minute units and
///
Minute,
/// Second units and
///
Second,
/// Millisecond units and
///
Millisecond
}
///
/// Enumeration type for the various symbol shapes that are available
///
///
public enum SymbolType
{
/// Square-shaped
Square,
/// Rhombus-shaped
Diamond,
/// Equilateral triangle
Triangle,
/// Uniform circle
Circle,
/// "X" shaped . This symbol cannot
/// be filled since it has no outline.
XCross,
/// "+" shaped . This symbol cannot
/// be filled since it has no outline.
Plus,
/// Asterisk-shaped . This symbol
/// cannot be filled since it has no outline.
Star,
/// Unilateral triangle , pointing
/// down.
TriangleDown,
///
/// Horizontal dash . This symbol cannot be
/// filled since it has no outline.
///
HDash,
///
/// Vertical dash . This symbol cannot be
/// filled since it has no outline.
///
VDash,
/// A Default symbol type (the symbol type will be obtained
/// from .
Default,
/// No symbol is shown (this is equivalent to using
/// = false.
None
}
///
/// Enumeration type that defines the possible legend locations
///
///
public enum LegendPos
{
///
/// Locate the above the
///
Top,
///
/// Locate the on the left side of the
///
Left,
///
/// Locate the on the right side of the
///
Right,
///
/// Locate the below the
///
Bottom,
///
/// Locate the inside the in the
/// top-left corner.
///
InsideTopLeft,
///
/// Locate the inside the in the
/// top-right corner.
///
InsideTopRight,
///
/// Locate the inside the in the
/// bottom-left corner.
///
InsideBotLeft,
///
/// Locate the inside the in the
/// bottom-right corner.
///
InsideBotRight,
///
/// Locate the as a floating object above the graph at the
/// location specified by .
///
Float,
///
/// Locate the centered above the
///
TopCenter,
///
/// Locate the centered below the
///
BottomCenter,
///
/// Locate the above the , but flush
/// against the left margin of the .
///
TopFlushLeft,
///
/// Locate the below the , but flush
/// against the left margin of the .
///
BottomFlushLeft
}
///
/// Enumeration type for the different horizontal text alignment options
///
///
public enum AlignH
{
///
/// Position the text so that its left edge is aligned with the
/// specified X,Y location. Used by the
/// method.
///
Left,
///
/// Position the text so that its center is aligned (horizontally) with the
/// specified X,Y location. Used by the
/// method.
///
Center,
///
/// Position the text so that its right edge is aligned with the
/// specified X,Y location. Used by the
/// method.
///
Right
}
///
/// Enumeration type for the different proximal alignment options
///
///
///
public enum AlignP
{
///
/// Position the text so that its "inside" edge (the edge that is
/// nearest to the alignment reference point or object) is aligned.
/// Used by the method to align text
/// to the axis.
///
Inside,
///
/// Position the text so that its center is aligned with the
/// reference object or point.
/// Used by the method to align text
/// to the axis.
///
Center,
///
/// Position the text so that its right edge (the edge that is
/// farthest from the alignment reference point or object) is aligned.
/// Used by the method to align text
/// to the axis.
///
Outside
}
///
/// Enumeration type for the different vertical text alignment options
///
/// specified X,Y location. Used by the
/// method.
public enum AlignV
{
///
/// Position the text so that its top edge is aligned with the
/// specified X,Y location. Used by the
/// method.
///
Top,
///
/// Position the text so that its center is aligned (vertically) with the
/// specified X,Y location. Used by the
/// method.
///
Center,
///
/// Position the text so that its bottom edge is aligned with the
/// specified X,Y location. Used by the
/// method.
///
Bottom
}
///
/// Enumeration type for the user-defined coordinate types available.
/// These coordinate types are used the objects
/// and objects only.
///
///
public enum CoordType
{
///
/// Coordinates are specified as a fraction of the
/// . That is, for the X coordinate, 0.0
/// is at the left edge of the ChartRect and 1.0
/// is at the right edge of the ChartRect. A value less
/// than zero is left of the ChartRect and a value
/// greater than 1.0 is right of the ChartRect. For the Y coordinate, 0.0
/// is the top and 1.0 is the bottom.
///
ChartFraction,
///
/// Coordinates are specified as a fraction of the
/// . That is, for the X coordinate, 0.0
/// is at the left edge of the Rect and 1.0
/// is at the right edge of the Rect. A value less
/// than zero is left of the Rect and a value
/// greater than 1.0 is right of the Rect. For the Y coordinate, 0.0
/// is the top and 1.0 is the bottom. Note that
/// any value less than zero or greater than 1.0 will be outside
/// the Rect, and therefore clipped.
///
PaneFraction,
///
/// Coordinates are specified according to the user axis scales
/// for the and .
///
AxisXYScale,
///
/// Coordinates are specified according to the user axis scales
/// for the and .
///
AxisXY2Scale,
///
/// The X coordinate is specified as a fraction of the ,
/// and the Y coordinate is specified as a fraction of the .
///
///
/// For the X coordinate, 0.0
/// is at the left edge of the ChartRect and 1.0
/// is at the right edge of the ChartRect. A value less
/// than zero is left of the ChartRect and a value
/// greater than 1.0 is right of the ChartRect. For the Y coordinate, a value of zero is at
/// the left side of the pane, and a value of 1.0 is at the right side of the pane.
///
XChartFractionYPaneFraction,
///
/// The X coordinate is specified as a fraction of the ,
/// and the Y coordinate is specified as a fraction of the .
///
///
/// For the X coordinate, a value of zero is at
/// the left side of the pane, and a value of 1.0 is at the right side of the pane.
/// For the Y coordinate, 0.0
/// is at the top edge of the ChartRect and 1.0
/// is at the bottom edge of the ChartRect. A value less
/// than zero is above the ChartRect and a value
/// greater than 1.0 is below the ChartRect.
///
XPaneFractionYChartFraction,
///
/// The X coordinate is specified as an X Scale value, and the Y coordinate
/// is specified as a fraction of the .
///
///
/// For the X coordinate, the value just corresponds to the values of the X scale.
/// Values outside the scale range will be
/// outside the . For the Y coordinate, 0.0
/// is at the top edge of the ChartRect and 1.0
/// is at the bottom edge of the ChartRect. A value less
/// than zero is above the ChartRect and a value
/// greater than 1.0 is below the ChartRect.
///
XScaleYChartFraction,
///
/// The X coordinate is specified as a fraction of the
/// and the Y coordinate is specified as
/// a Y scale value.
///
///
/// For the X coordinate, 0.0
/// is at the left edge of the ChartRect and 1.0
/// is at the right edge of the ChartRect. A value less
/// than zero is left of the ChartRect and a value
/// greater than 1.0 is right of the ChartRect. For the Y coordinate, the value just
/// corresponds to the values of the Y scale. Values outside the scale range will be
/// outside the .
///
XChartFractionYScale,
///
/// The X coordinate is specified as a fraction of the
/// and the Y coordinate is specified as
/// a Y2 scale value.
///
///
/// For the X coordinate, 0.0
/// is at the left edge of the ChartRect and 1.0
/// is at the right edge of the ChartRect. A value less
/// than zero is left of the ChartRect and a value
/// greater than 1.0 is right of the ChartRect. For the Y coordinate, the value just
/// corresponds to the values of the Y2 scale. Values outside the scale range will be
/// outside the .
///
XChartFractionY2Scale
}
///
/// Enumeration type that defines how a curve is drawn. Curves can be drawn
/// as ordinary lines by connecting the points directly, or in a stair-step
/// fashion as a series of discrete, constant values. In a stair step plot,
/// all lines segments are either horizontal or vertical. In a non-step (line)
/// plot, the lines can be any angle.
///
///
public enum StepType
{
///
/// Draw the as a stair-step in which each
/// point defines the
/// beginning (left side) of a new stair. This implies the points are
/// defined at the beginning of an "event."
///
ForwardStep,
///
/// Draw the as a stair-step in which each
/// point defines the end (right side) of a new stair. This implies
/// the points are defined at the end of an "event."
///
RearwardStep,
///
/// Draw the as an ordinary line, in which the
/// points are connected directly by line segments.
///
NonStep
}
///
/// Enumeration type that defines the base axis from which graphs
/// are displayed. The bars can be drawn on any of the four axes (,
/// , , and ).
///
///
public enum BarBase
{
///
/// Draw the chart based from the .
///
X,
///
/// Draw the chart based from the .
///
X2,
///
/// Draw the chart based from the .
///
Y,
///
/// Draw the chart based from the .
///
Y2
}
///
/// Enumeration type that defines the available types of graphs.
///
///
public enum LineType
{
///
/// Draw the lines as normal. Any fill area goes from each line down to the X Axis.
///
Normal,
///
/// Draw the lines stacked on top of each other, accumulating values to a total value.
///
Stack
}
///
/// Enumeration type that defines the available types of graphs.
///
///
public enum BarType
{
///
/// Draw each side by side in clusters.
///
Cluster,
///
/// Draw each side by side in clusters, also use the "Z" value from the
/// to define the bottom of each bar. This is very similar to
/// a , except that multiple bars will be automatically clustered, and
/// the bar width is defined according to available space rather than as a fixed width setting.
///
ClusterHiLow,
///
/// Draw the bars one on top of the other. The bars will
/// be drawn such that the last bar in the will be behind
/// all other bars. Note that the bar values are not summed up for the overlay
/// mode. The data values must be summed before being passed
/// to .
/// For example, if the first bar of
/// the first has a value of 100, and the first bar of
/// the second has a value of 120, then that bar will
/// appear to be 20 units on top of the first bar.
///
Overlay,
///
/// Draw the bars one on top of the other. The bars will
/// be drawn such that the bars are sorted according to the maximum value, with
/// the tallest bar at each point at the back and the shortest bar at the front.
/// This is similar to the mode, but the bars are sorted at
/// each base value.
/// The data values must be summed before being passed
/// to . For example, if the first bar of
/// the first has a value of 100, and the first bar of
/// the second has a value of 120, then that bar will
/// appear to be 20 units on top of the first bar.
///
SortedOverlay,
///
/// Draw the bars in an additive format so that they stack on
/// top of one another. The value of the last bar drawn will be the sum of the values
/// of all prior bars.
///
Stack,
///
/// Draw the bars in a format whereby the height of each
/// represents the percentage of the total each one represents. Negative values
///are displayed below the zero line as percentages of the absolute total of all values.
///
PercentStack
}
///
/// Enumeration type that defines which set of data points - X or Y - is used
/// to perform the sort.
///
public enum SortType
{
///
/// Use the Y values to sort the list.
///
YValues,
///
/// Use the X values to sort the list.
///
XValues
};
///
/// Enumeration that specifies a Z-Order position for
/// objects.
///
/// This enumeration allows you to set the layering of various graph
/// features. Except for the objects, other feature types
/// all have a fixed depth as follows (front to back):
///
/// objects
/// The border around
/// objects
/// The features
/// The background fill of the
/// The pane
/// The background fill of the
///
/// You cannot place anything behind the
/// background fill, but allows you to
/// explicitly control the depth of objects
/// between all other object types. For items of equal ,
/// such as multiple 's or 's
/// having the same value, the relative depth is
/// controlled by the ordinal position in the list (either
/// or ).
/// objects
/// can be placed in the of either a
/// or a . For a
/// -based , all
/// values are applicable. For a -based
/// , any value can be used, but there
/// are really only three depths:
/// will place the item behind the pane title,
/// will place on top of all other graph features,
/// any other value places the object above the pane title, but behind the 's.
///
///
public enum ZOrder
{
///
/// Specifies that the will be behind all other
/// objects (including the ).
///
H_BehindAll,
///
/// Specifies that the will be behind the
/// background
/// (see ).
///
G_BehindChartFill,
///
/// Specifies that the will be behind the grid lines.
///
F_BehindGrid,
///
/// Specifies that the will be behind the
/// objects.
///
E_BehindCurves,
///
/// Specifies that the will be behind the
/// objects.
///
D_BehindAxis,
///
/// Specifies that the will be behind the
/// border.
///
C_BehindChartBorder,
///
/// Specifies that the will be behind the
/// object.
///
B_BehindLegend,
///
/// Specifies that the will be in front of
/// all other objects, except for the other
/// objects that have the same and are before
/// this object in the .
///
A_InFront
}
///
/// Enumeration that determines the type of label that is displayed for each pie slice
/// (see ).
///
public enum PieLabelType
{
///
/// Displays and for
/// a slice in a Pie Chart.
///
Name_Value,
///
/// Displays and (as % of total) for
/// a slice in a Pie Chart.
///
Name_Percent,
///
/// Displays a containing the both
/// as an absolute number and as percentage of the total.
///
Name_Value_Percent,
///
/// Displays for
/// a slice in a Pie Chart.
///
Value,
///
/// Displays (as % of total) for
/// a slice in a Pie Chart.
///
Percent,
///
/// Displays for a slice in a Pie Chart.
///
Name,
///
///No label displayed.
///
None
}
///
/// Define the auto layout options for the
/// method.
///
public enum PaneLayout
{
///
/// Layout the 's so they are in a square grid (always 2x2, 3x3, 4x4),
/// leaving blank spaces as required.
///
/// For example, a single pane would generate a 1x1 grid, between 2 and 4 panes would generate
/// a 2x2 grid, 5 to 9 panes would generate a 3x3 grid.
ForceSquare,
///
/// Layout the 's so they are in a general square (2x2, 3x3, etc.), but use extra
/// columns when necessary (row x column = 1x2, 2x3, 3x4, etc.) depending on the total number
/// of panes required.
///
/// For example, a 2x2 grid has four panes and a 3x3 grid has 9 panes. If there are
/// 6 panes required, then this option will eliminate a row (column preferred) to make a
/// 2 row x 3 column grid. With 7 panes, it will make a 3x3 grid with 2 empty spaces.
SquareColPreferred,
///
/// Layout the 's so they are in a general square (2x2, 3x3, etc.), but use extra
/// rows when necessary (2x1, 3x2, 4x3, etc.) depending on the total number of panes required.
///
/// For example, a 2x2 grid has four panes and a 3x3 grid has 9 panes. If there are
/// 6 panes required, then this option will eliminate a column (row preferred) to make a
/// 3 row x 2 column grid. With 7 panes, it will make a 3x3 grid with 2 empty spaces.
SquareRowPreferred,
///
/// Layout the 's in a single row
///
SingleRow,
///
/// Layout the 's in a single column
///
SingleColumn,
///
/// Layout the 's with an explicit number of columns: The first row has
/// 1 column and the second row has 2 columns for a total of 3 panes.
///
ExplicitCol12,
///
/// Layout the 's with an explicit number of columns: The first row has
/// 2 columns and the second row has 1 column for a total of 3 panes.
///
ExplicitCol21,
///
/// Layout the 's with an explicit number of columns: The first row has
/// 2 columns and the second row has 3 columns for a total of 5 panes.
///
ExplicitCol23,
///
/// Layout the 's with an explicit number of columns: The first row has
/// 3 columns and the second row has 2 columns for a total of 5 panes.
///
ExplicitCol32,
///
/// Layout the 's with an explicit number of rows: The first column has
/// 1 row and the second column has 2 rows for a total of 3 panes.
///
ExplicitRow12,
///
/// Layout the 's with an explicit number of rows: The first column has
/// 2 rows and the second column has 1 row for a total of 3 panes.
///
ExplicitRow21,
///
/// Layout the 's with an explicit number of rows: The first column has
/// 2 rows and the second column has 3 rows for a total of 5 panes.
///
ExplicitRow23,
///
/// Layout the 's with an explicit number of rows: The first column has
/// 3 rows and the second column has 2 rows for a total of 5 panes.
///
ExplicitRow32
}
///
/// Enum for specifying the type of data to be returned by the ZedGraphWeb Render() method.
///
public enum RenderModeType
{
///
/// Renders as an IMG tag referencing a local generated image. ContentType stays text.
///
ImageTag,
///
/// Renders the binary image. ContentType is changed accordingly.
///
RawImage
}
}