BaseRenderableSeries
Defines the Base class for all RenderableSeries within Ultrachart.
Inherits: ContentControl
Implements: IRenderableSeries, IRenderableSeriesBase, IDrawable, IXmlSerializable
Constructors
protected BaseRenderableSeries()
baseRenderableSeries = BaseRenderableSeries()
Initializes a new instance of the BaseRenderableSeries class.
Properties
public bool AntiAliasing { get; set; }
value = baseRenderableSeries.AntiAliasing
baseRenderableSeries.AntiAliasing = value
Gets or sets whether this series uses AntiAliasing when drawn
public IRenderPassData CurrentRenderPassData { get; set; }
value = baseRenderableSeries.CurrentRenderPassData
baseRenderableSeries.CurrentRenderPassData = value
Gets or sets the RenderPassData instance used for this render pass
public IDataSeries DataSeries { get; set; }
value = baseRenderableSeries.DataSeries
baseRenderableSeries.DataSeries = value
Gets or sets the DataSeries associated with this series
public virtual bool DisplaysDataAsXy { get; private set; }
value = baseRenderableSeries.DisplaysDataAsXy
baseRenderableSeries.DisplaysDataAsXy = value
If true, the data is displayed as XY, e.g. like a Scatter plot, not a line (time) series
public LineDrawMode DrawNaNAs { get; set; }
value = baseRenderableSeries.DrawNaNAs
baseRenderableSeries.DrawNaNAs = value
Gets or sets a value indicating how this renderable series will treat double.NaN. See LineDrawMode for available options
public bool IsSelected { get; set; }
value = baseRenderableSeries.IsSelected
baseRenderableSeries.IsSelected = value
Gets or sets the IsSelectedProperty.
internal virtual bool IsValidForDrawing { get; }
value = baseRenderableSeries.IsValidForDrawing
Gets a value indicating whether this BaseRenderableSeries is valid for drawing.
public bool IsVisible { get; set; }
value = baseRenderableSeries.IsVisible
baseRenderableSeries.IsVisible = value
Gets or sets whether the series is visible when drawn
public DataTemplate LegendMarkerTemplate { get; set; }
value = baseRenderableSeries.LegendMarkerTemplate
baseRenderableSeries.LegendMarkerTemplate = value
Gets or sets the DataTemplate, which defines the Visual to be rendered on the UltrachartLegend as a series marker
public IPaletteProvider PaletteProvider { get; set; }
value = baseRenderableSeries.PaletteProvider
baseRenderableSeries.PaletteProvider = value
Gets or Sets an optional IPaletteProvider instance, which may be used to override specific data-point colors during rendering. For more details, see the IPaletteProvider documentation
public IPointMarker PointMarker { get; set; }
value = baseRenderableSeries.PointMarker
baseRenderableSeries.PointMarker = value
Gets or sets a BasePointMarker instance directly on the BaseRenderableSeries. When a BasePointMarker is present, then the markers will be drawn at each data-point in the series
public ControlTemplate PointMarkerTemplate { get; set; }
value = baseRenderableSeries.PointMarkerTemplate
baseRenderableSeries.PointMarkerTemplate = value
Gets or sets the PointMarker ControlTemplate, which defines the point-marker Visual to be rendered on each datapoint of the series
public ResamplingMode ResamplingMode { get; set; }
value = baseRenderableSeries.ResamplingMode
baseRenderableSeries.ResamplingMode = value
Gets or sets the ResamplingMode used when drawing this series
public int ResamplingResolution { get; set; }
value = baseRenderableSeries.ResamplingResolution
baseRenderableSeries.ResamplingResolution = value
Gets or sets the resampling resolution. The default is 2, which results in Nyquist resampling. Lower values are not permitted. Higher values result in potentially more visually accurate rendering, but at the expense of performance
public FrameworkElement RolloverMarker { get; }
value = baseRenderableSeries.RolloverMarker
Gets a cached Framework Element which is used as a Rollover Marker. This is generated from a ControlTemplate in xaml via the RolloverMarkerTemplateProperty DependencyProperty
public ControlTemplate RolloverMarkerTemplate { get; set; }
value = baseRenderableSeries.RolloverMarkerTemplate
baseRenderableSeries.RolloverMarkerTemplate = value
Gets or sets the RolloverMarker ControlTemplate, which defines the Visual to be rendered on the series when the RolloverModifier is enabled and the user moves the mouse.
public Style SelectedSeriesStyle { get; set; }
value = baseRenderableSeries.SelectedSeriesStyle
baseRenderableSeries.SelectedSeriesStyle = value
Gets or sets a style for selected series.
public Color SeriesColor { get; set; }
value = baseRenderableSeries.SeriesColor
baseRenderableSeries.SeriesColor = value
Gets or sets the SeriesColor.
public IServiceContainer Services { get; set; }
value = baseRenderableSeries.Services
baseRenderableSeries.Services = value
Gets the ServiceContainer which provides access to services throughout Ultrachart. ServiceContainers are created one per UltrachartSurface instance, and shared between peripheral components such as AxisBase, BaseRenderableSeries, ChartModifierBase instances. For a full list of available services, see the remarks on ServiceContainer
public int StrokeThickness { get; set; }
value = baseRenderableSeries.StrokeThickness
baseRenderableSeries.StrokeThickness = value
Gets or sets the StrokeThickness of the line.
public IAxis XAxis { get; set; }
value = baseRenderableSeries.XAxis
baseRenderableSeries.XAxis = value
Gets or sets the XAxis that this IRenderableSeries is associated with
public string XAxisId { get; set; }
value = baseRenderableSeries.XAxisId
baseRenderableSeries.XAxisId = value
Gets or sets the ID of the X-Axis which this renderable series is measured against
public IAxis YAxis { get; set; }
value = baseRenderableSeries.YAxis
baseRenderableSeries.YAxis = value
Gets or sets the YAxis that this IRenderableSeries is associated with
public string YAxisId { get; set; }
value = baseRenderableSeries.YAxisId
baseRenderableSeries.YAxisId = value
Gets or sets the ID of the Y-Axis which this renderable series is measured against
public double ZeroLineY { get; set; }
value = baseRenderableSeries.ZeroLineY
baseRenderableSeries.ZeroLineY = value
Gets or sets the value which determines the zero line in Y direction. Used to set the bottom of a column, or the zero line in a mountain
Methods
protected void AssertDataPointType<TSeriesPoint>(string dataSeriesType)
baseRenderableSeries.AssertDataPointType(dataSeriesType)
Used internally by the renderer. Asserts that the input data-type is of the correct format for the current BaseRenderableSeries
- dataSeriesType
- Type of the data series.
protected static bool CheckIsInBounds(double coord, double lowerBound, double upperBound)
result = BaseRenderableSeries.CheckIsInBounds(coord, lowerBound, upperBound)
Returns True if the coordinate is between the lower and upper bounds supplied
- coord
- lowerBound
- upperBound
protected virtual void CreateRolloverMarker()
baseRenderableSeries.CreateRolloverMarker()
Creates a RolloverMarker from the RolloverMarkerTemplate property
protected double GetChartRotationAngle(IRenderPassData renderPassData)
result = baseRenderableSeries.GetChartRotationAngle(renderPassData)
Used Internally: Gets the rotation angle of the chart, which is 0 degrees or 90 degrees depending on whether the parent UltrachartSurface has swapped X and Y Axes or not.
- renderPassData
- The current IRenderPassData
public int GetDatapointWidth(ICoordinateCalculator<double> xCoordinateCalculator, IPointSeries pointSeries, double widthFraction)
result = baseRenderableSeries.GetDatapointWidth(xCoordinateCalculator, pointSeries, widthFraction)
Gets the width of data-points, used to compute column and OHLC bar widths
- xCoordinateCalculator
- The current x coordinate calculator.
- pointSeries
- The current IPointSeries being rendered.
- widthFraction
- The width fraction from 0.0 to 1.0, where 0.0 is infinitey small, 0.5 takes up half the available width and 1.0 means a data-point is the full width between points
public int GetDatapointWidth(ICoordinateCalculator<double> xCoordinateCalculator, IPointSeries pointSeries, double barsAmount, double widthFraction)
result = baseRenderableSeries.GetDatapointWidth(xCoordinateCalculator, pointSeries, barsAmount, widthFraction)
Gets the width of data-points, used to compute column and OHLC bar widths
- xCoordinateCalculator
- The current x coordinate calculator.
- pointSeries
- The current IPointSeries being rendered.
- barsAmount
- Amount of bars within viewport
- widthFraction
- The width fraction from 0.0 to 1.0, where 0.0 is infinitey small, 0.5 takes up half the available width and 1.0 means a data-point is the full width between points
protected HitTestInfo GetHitTestInfo(int nearestDataPointIndex, Point rawPoint, double hitTestRadius, IComparable hitXValue)
result = baseRenderableSeries.GetHitTestInfo(nearestDataPointIndex, rawPoint, hitTestRadius, hitXValue)
- rawPoint
- hitTestRadius
- is used to calculate HitTestInfo.IsHit
- nearestDataPointIndex
- hitXValue
protected virtual bool GetIsValidForDrawing()
result = baseRenderableSeries.GetIsValidForDrawing()
Gets a value indicating whether this BaseRenderableSeries is valid for drawing.
protected internal IUltrachartSurface GetParentSurface()
result = baseRenderableSeries.GetParentSurface()
Gets the parent IUltrachartSurface for this BaseRenderableSeries
protected IPointMarker GetPointMarker()
result = baseRenderableSeries.GetPointMarker()
Returns the PointMarker used by this series
public XmlSchema GetSchema()
result = baseRenderableSeries.GetSchema()
Returns an XmlSchema that describes the XML representation of the object that is produced by the WriteXml method and consumed by the ReadXml method
protected virtual double GetSeriesBodyLowerDataBound(HitTestInfo nearestHitPoint)
result = baseRenderableSeries.GetSeriesBodyLowerDataBound(nearestHitPoint)
When overridden in derived classes, returns the lower value of a compound data point, which is defined by the passed coordinate
protected virtual double GetSeriesBodyUpperDataBound(HitTestInfo nearestHitPoint)
result = baseRenderableSeries.GetSeriesBodyUpperDataBound(nearestHitPoint)
When overridden in derived classes, returns the upper value of a compound data point, which is defined by the passed coordinate
protected virtual double GetSeriesBodyWidth(HitTestInfo nearestHitPoint)
result = baseRenderableSeries.GetSeriesBodyWidth(nearestHitPoint)
When overridden in derived classes, returns the width of a single bar, which is defined by the passed coordinate
public virtual SeriesInfo GetSeriesInfo(HitTestInfo hitTestInfo)
result = baseRenderableSeries.GetSeriesInfo(hitTestInfo)
Converts the result of a Hit-Test operation (HitTestInfo) to a SeriesInfo class, which may be used as a ViewModel when outputting series values as bindings. SeriesInfo is used by the RolloverModifier, CursorModifier and UltrachartLegend classes
- hitTestInfo
public virtual IRange GetXRange()
result = baseRenderableSeries.GetXRange()
Returns the data range of the assosiated IDataSeries on X direction
public virtual IRange GetYRange(IRange xRange, bool getPositiveRange)
result = baseRenderableSeries.GetYRange(xRange, getPositiveRange)
Returns the data range of the assosiated IDataSeries on Y direction The X-Axis Range currently in viewIndicates whether to return positive YRange only
public IRange GetYRange(IRange xRange)
result = baseRenderableSeries.GetYRange(xRange)
Returns the data range of the assosiated IDataSeries on Y direction The X-Axis Range currently in view
protected virtual double GetYZeroCoord()
result = baseRenderableSeries.GetYZeroCoord()
Returns a value that determines the position of Y zero line on a chart. Significant for the series types that render negative data points differently, such as the FastColumnRenderableSeries, FastMountainRenderableSeries, FastImpulseRenderableSeries.
Returns: The value in pixels indicating the position of zero line
public HitTestInfo HitTest(Point rawPoint, bool interpolate)
result = baseRenderableSeries.HitTest(rawPoint, interpolate)
Performs a hit-test at the specific mouse point (X,Y coordinate on the parent UltrachartSurface) with the default HitTestRadius, returning a HitTestInfo struct with the results
- rawPoint
- The mouse point on the parent UltrachartSurface
- interpolate
- If true, use interpolation to perform a hit-test between data-points, or on the area if a , or
Returns: A HitTestInfo struct with the results
public virtual HitTestInfo HitTest(Point rawPoint, double hitTestRadius, bool interpolate)
result = baseRenderableSeries.HitTest(rawPoint, hitTestRadius, interpolate)
Performs a hit-test at the specific mouse point (X,Y coordinate on the parent UltrachartSurface) using passed , returning a HitTestInfo struct with the results
- rawPoint
- The mouse point on the parent UltrachartSurface
- hitTestRadius
- The radius in pixels to determine whether a mouse is over a data-point
- interpolate
- If true, use interpolation to perform a hit-test between data-points, or on the area if a , or
Returns: A HitTestInfo struct with the results
protected abstract void InternalDraw(IRenderContext2D renderContext, IRenderPassData renderPassData)
baseRenderableSeries.InternalDraw(renderContext, renderPassData)
Draws the series using the IRenderContext2D and the IRenderPassData passed in
- renderContext
- The render context. This is a graphics object which has methods to draw lines, quads and polygons to the screen
- renderPassData
- The render pass data. Contains a resampled IPointSeries, the IndexRange of points on the screen and the current YAxis and XAxis ICoordinateCalculator to convert data-points to screen points
protected virtual HitTestInfo InterpolatePoint(Point rawPoint, HitTestInfo nearestHitResult, double hitTestRadius)
result = baseRenderableSeries.InterpolatePoint(rawPoint, nearestHitResult, hitTestRadius)
Interpolation function called by Boolean) when the inpolate flag is true
- rawPoint
- Mouse point
- nearestHitResult
- Non-interpolated HitTestInfo
- hitTestRadius
- The value, which indicates distance used to consider whether the series is hit or not
Returns: Intepolated HitTestInfo
protected virtual bool IsBodyHit(Point pt, Rect boundaries, HitTestInfo nearestHitPoint)
result = baseRenderableSeries.IsBodyHit(pt, boundaries, nearestHitPoint)
When overridden in derived classes, performs the hit-test check on the bounding rect of a single series bar
- pt
- boundaries
- nearestHitPoint
protected virtual bool IsHitTest(Point rawPoint, HitTestInfo nearestHitResult, double hitTestRadius, Point previousDataPoint, Point nextDataPoint)
result = baseRenderableSeries.IsHitTest(rawPoint, nearestHitResult, hitTestRadius, previousDataPoint, nextDataPoint)
When overridden in derived classes, performs hit test on series using interpolated values
- rawPoint
- nearestHitResult
- hitTestRadius
- previousDataPoint
- nextDataPoint
protected virtual HitTestInfo NearestHitResult(Point mouseRawPoint, double hitTestRadiusInPixels, SearchMode searchMode, bool considerYCoordinateForDistanceCalculation)
result = baseRenderableSeries.NearestHitResult(mouseRawPoint, hitTestRadiusInPixels, searchMode, considerYCoordinateForDistanceCalculation)
Called by Boolean) to get the nearest (non-interpolated) HitTestInfo to the mouse point
- mouseRawPoint
- The mouse point
- hitTestRadiusInPixels
- The radius (in pixels) to use when determining if the is over a data-point
- searchMode
- The search mode.
- considerYCoordinateForDistanceCalculation
- if set to true then perform a true euclidean distance to find the nearest hit result.
Returns: The HitTestInfo result
protected virtual void OnDataSeriesDependencyPropertyChanged(IDataSeries oldDataSeries, IDataSeries newDataSeries)
baseRenderableSeries.OnDataSeriesDependencyPropertyChanged(oldDataSeries, newDataSeries)
Called when the DataSeries property changes - i.e. a new IDataSeries has been set
- oldDataSeries
- The old IDataSeries
- newDataSeries
- The new IDataSeries
protected virtual void OnDataSeriesDependencyPropertyChanged()
baseRenderableSeries.OnDataSeriesDependencyPropertyChanged()
Called when the DataSeries dependency property changes.
protected static void OnInvalidateParentSurface(DependencyObject d, DependencyPropertyChangedEventArgs e)
BaseRenderableSeries.OnInvalidateParentSurface(d, e)
When called, invalidates the parent UltrachartSurface
- d
- The DependencyObject that raised the event.
- e
- The DependencyPropertyChangedEventArgs instance containing the event data.
public virtual void OnInvalidateParentSurface()
baseRenderableSeries.OnInvalidateParentSurface()
Raises the InvalidateUltrachartMessage which causes the parent UltrachartSurface to invalidate
protected virtual void OnParentSurfaceViewportSizeChanged()
baseRenderableSeries.OnParentSurfaceViewportSizeChanged()
Called when the parent surface viewport size changes, immediately before a draw pass
protected virtual void OnResamplingModeChanged()
baseRenderableSeries.OnResamplingModeChanged()
Called when resampling mode changes
protected virtual void OnSeriesColorChanged()
baseRenderableSeries.OnSeriesColorChanged()
Called when the SeriesColor dependency property changes. Allows derived types to do caching
public virtual void ReadXml(XmlReader reader)
baseRenderableSeries.ReadXml(reader)
Generates BaseRenderableSeries from its XML representation.
- reader
StockSharp#Xaml#Charting#Visuals#IDrawable#OnDraw(IRenderContext2D, IRenderPassData)
Called when the instance is drawn
- renderContext
- The IRenderContext2D used for drawing
- renderPassData
- The current render pass data
protected Point TransformPoint(float x, float y, bool isVerticalChart)
result = baseRenderableSeries.TransformPoint(x, y, isVerticalChart)
Transposes a point (swaps X, Y) if the flag is true
- x
- The X-Value
- y
- The Y-Value
- isVerticalChart
- A flag indicating the orientation of the chart
Returns: The transposed point
protected Point TransformPoint(Point point, bool isVerticalChart)
result = baseRenderableSeries.TransformPoint(point, isVerticalChart)
Used internally: Transposes a Point depending on whether the current UltrachartSurface is being drawn vertically or not
- point
- isVerticalChart
public HitTestInfo VerticalSliceHitTest(Point rawPoint, bool interpolate)
result = baseRenderableSeries.VerticalSliceHitTest(rawPoint, interpolate)
Performs a hit-test at the specific mouse point with zero hit-test radius. Method considers only X value and returns a HitTestInfo struct based on the data point with the closest X value
- rawPoint
- The mouse point on the parent UltrachartSurface
- interpolate
- If true, use interpolation to perform a hit-test between data-points, or on the area if a , or
Returns: A HitTestInfo struct with the results
public virtual void WriteXml(XmlWriter writer)
baseRenderableSeries.WriteXml(writer)
Converts BaseRenderableSeries into its XML representation.
- writer
Events
public event EventHandler SelectionChanged
baseRenderableSeries.SelectionChanged += handler
Event raised whenever IsSelected property changed
Fields
public static readonly DependencyProperty AntiAliasingProperty
value = BaseRenderableSeries.AntiAliasingProperty
Defines the AntiAliasing DependencyProperty
public static readonly DependencyProperty DataSeriesIndexProperty
value = BaseRenderableSeries.DataSeriesIndexProperty
Defines the DataSeriesIndex DependencyProperty
public static readonly DependencyProperty DataSeriesProperty
value = BaseRenderableSeries.DataSeriesProperty
Defines the DataSeries DependencyProperty
private const int DefaultDatapointWidth
value = BaseRenderableSeries.DefaultDatapointWidth
Default datapoint width used when there is only one point in point series
public const double DefaultHitTestRadius
value = BaseRenderableSeries.DefaultHitTestRadius
A default radius used in the Boolean) method for interpolation, in RoloverModifier and instead of PointMarker size when it is not set
public static readonly DependencyProperty DrawNaNAsProperty
value = BaseRenderableSeries.DrawNaNAsProperty
Defines the DrawNaNAs DependencyProperty
public static readonly DependencyProperty IsSelectedProperty
value = BaseRenderableSeries.IsSelectedProperty
Defines the IsSelected DependencyProperty
public static readonly DependencyProperty IsVisibleProperty
value = BaseRenderableSeries.IsVisibleProperty
Defines the IsVisible DependencyProperty
public static readonly DependencyProperty LegendMarkerTemplateProperty
value = BaseRenderableSeries.LegendMarkerTemplateProperty
Defines the LegendMarkerTemplate DependencyProperty
public static readonly DependencyProperty PaletteProviderProperty
value = BaseRenderableSeries.PaletteProviderProperty
Defines the PaletteProvider DependencyProperty
public static readonly DependencyProperty PointMarkerProperty
value = BaseRenderableSeries.PointMarkerProperty
Defines the PointMarker DependencyProperty
public static readonly DependencyProperty PointMarkerTemplateProperty
value = BaseRenderableSeries.PointMarkerTemplateProperty
Defines the PointMarkerTemplate DependencyProperty
public static readonly DependencyProperty ResamplingModeProperty
value = BaseRenderableSeries.ResamplingModeProperty
Defines the ResamplingMode DependencyProperty
public static readonly DependencyProperty RolloverMarkerTemplateProperty
value = BaseRenderableSeries.RolloverMarkerTemplateProperty
Defines the RolloverMarkerTemplate DependencyProperty
public static readonly DependencyProperty SelectedSeriesStyleProperty
value = BaseRenderableSeries.SelectedSeriesStyleProperty
Defines the SelectedSelectedSeriesStyle DependencyProperty
public static readonly DependencyProperty SeriesColorProperty
value = BaseRenderableSeries.SeriesColorProperty
Defines the SeriesColor DependencyProperty
public static readonly DependencyProperty StrokeThicknessProperty
value = BaseRenderableSeries.StrokeThicknessProperty
Defines the StrokeThickness DependencyProperty
public static readonly DependencyProperty XAxisIdProperty
value = BaseRenderableSeries.XAxisIdProperty
Defines the AxisAlignment DependencyProperty
public static readonly DependencyProperty YAxisIdProperty
value = BaseRenderableSeries.YAxisIdProperty
Defines the AxisAlignment DependencyProperty
public static readonly DependencyProperty ZeroLineYProperty
value = BaseRenderableSeries.ZeroLineYProperty
Defines the ZeroLineY DependencyProperty