Bars
public BarHistory BarsReturns the BarHistory instance currently associated with this plot object. If BarsOverride is not null, Bars returns that instance instead of the BarHistory being charted.
API documentation, members, signatures, and C# examples.
Find classes, members, and documentation.
PlotBase is the base class for objects that can be plotted on a WL9 chart. It provides access to the chart, pane, historical data, chart preferences, coordinate conversion, rendering passes, configuration, and a number of helper methods for rendering lines, rectangles, and text.
public BarHistory BarsReturns the BarHistory instance currently associated with this plot object. If BarsOverride is not null, Bars returns that instance instead of the BarHistory being charted.
public BarHistory BarsOverrideAllows a PlotBase instance to use a BarHistory other than the one currently displayed by the chart. When this property is not null, the Bars property returns BarsOverride instead of Chart.Bars.
public CoreChart ChartReturns the CoreChart associated with this plot object's Pane, or null if the plot object is not associated with a pane.
public ChartPreferences ChartPreferencesReturns the ChartPreferences that should be used when rendering this plot object. If ChartPreferencesOverride is not null, that instance is returned. Otherwise, the ChartPreferences of the associated Chart is returned.
public ChartPreferences ChartPreferencesOverrideAllows the plot object to use a ChartPreferences instance other than the one belonging to the associated chart.
public WLColor ColorSpecifies the primary color used when rendering this plot object. If the Parameters collection contains a Parameter named "Color", the property uses that Parameter's value. Otherwise, it uses the plot object's internal color value.
public override ConfigurableType ConfigurableTypeReturns ConfigurableType.ParameterList, indicating that PlotBase instances use a ParameterList for their configuration.
public Brush DefaultBrushReturns a WPF Brush using the plot object's current Color. The Brush is obtained through PenBrushFactory.
public Pen DefaultPenReturns the default WPF Pen for rendering this plot object. The Pen uses the plot object's current Color. Its default thickness is 2. If the Parameters collection contains a Parameter named "Thickness", that Parameter's integer value is used instead.
public virtual WLColor GetBarColor(int idx)Returns the color that should be used to render the bar at the specified idx. The default implementation returns the plot object's Color. Override this method when a plot object can render different bars using different colors.
public virtual double GetMaxValue(int start, int end)Returns the highest y-axis value required by the plot object within the specified start and end bar index range. Derived classes should override this method when their values affect the chart pane's vertical scaling. The default implementation returns Double.MinValue.
public virtual double GetMinValue(int start, int end)Returns the lowest y-axis value required by the plot object within the specified start and end bar index range. Derived classes should override this method when their values affect the chart pane's vertical scaling. The default implementation returns Double.MaxValue.
public virtual ValueMarker GetValueMarker()Returns a ValueMarker associated with this plot object. Derived classes can override this method to provide a value marker for display on the chart's value axis. The default implementation returns null.
public virtual bool IsMouseOver(Point pt)Returns true if the chart coordinate specified by pt is considered to be over this plot object. Derived classes can override this method to provide hit testing. The default implementation returns false.
public override string NameReturns the runtime type name of the PlotBase instance.
public byte OpacityGets or sets the opacity used when rendering this plot object. The property works with a Parameter named Opacity (0-100) when that Parameter is present in the Parameters collection. When read, the Parameter's 0-to-100 value is converted to a byte in the range 0 to 255. If no opacity Parameter exists, the property returns 255. When assigned, the supplied byte value is converted from the 0-to-255 range to the Parameter's 0-to-100 range.
public const string OPACITY_LABEL = "Opacity (0-100)"Contains the standard Parameter name used by PlotBase for an opacity Parameter.
public ChartPane PaneGets or sets the ChartPane associated with this plot object. The Chart property derives its value from this Pane.
public string PaneTagGets or sets the pane tag associated with this plot object. Plot objects such as indicators can use PaneTag to specify the chart pane in which they should be rendered.
public virtual string ConfigKeyInherited from Configurable. Contains the key used when WL9 saves this item's configuration to the user's local file system. By default, ConfigKey is composed from Name plus "_Configuration". Derived classes can override it when multiple Configurable objects should share the same configuration.
public string ConfigurationInherited from Configurable. Contains the item's configuration represented as a single string. For ParameterList-based objects such as PlotBase, the configuration is based on the Parameter instances contained in Parameters.
public virtual string DescriptionInherited from Configurable. Returns a short description of the configurable item. If the user edits the object's Parameters, this text can be displayed in the parameter editor dialog.
public virtual string EditConfig()Inherited from Configurable. The default implementation displays a Parameter editor that allows the user to modify the object's Parameters. Derived classes can override this method to provide a custom configuration interface.
public virtual bool IsConfigurableInherited from Configurable. Indicates whether the object exposes configuration that can be edited.
public ParameterList ParametersInherited from Configurable. Contains the Parameter instances that comprise the configuration for this plot object. See the ParameterList QuickRef entry for more information.
public virtual void Parse(string s)Restores PlotBase-specific state from the string specified in s. The method restores PaneTag, parses the persisted ParameterList, and assigns the saved Parameter values to the existing Parameters collection.
public virtual string Persist()Returns a string containing the state that PlotBase persists for the chart. The persisted data contains the plot object's pane tag followed by its serialized Parameters. If the object is currently associated with a Pane, the Pane's PaneTag is persisted. Otherwise, the object's PaneTag property is used.
public virtual void ProcessConfig()Inherited from Configurable. Processes the current Configuration after it has changed. Derived classes can override this method to perform additional processing after configuration changes.
public double ConvertDateTimeToX(DateTime dt)Converts the specified DateTime dt to an x-axis pixel coordinate on the chart. Returns 0 if the plot object is not associated with a Chart.
public double ConvertIndexToX(int idx)Converts the specified BarHistory index idx to an x-axis pixel coordinate. Returns 0 if the plot object is not associated with a Chart.
public double ConvertValueToY(double value)Converts the specified data value to a y-axis pixel coordinate using the associated Pane.
public DateTime ConvertXToDateTime(double x)Converts the x-axis pixel coordinate x to the corresponding DateTime on the chart. Returns DateTime.MinValue if the plot object is not associated with a Chart.
public virtual int ConvertXToIndex(double x)Converts the x-axis pixel coordinate x to an index in the BarHistory being charted. Returns 0 if the plot object is not associated with a Chart. Derived classes can override this behavior if they use a different x-axis mapping.
public double ConvertYToValue(double y)Converts the y-axis pixel coordinate y to a data value using the associated Pane.
public virtual bool HasMouseOverStateReturns true if the plot object has a special rendering state when the mouse is positioned over it. The default implementation returns false. Derived classes can override this property to support effects such as highlighting drawing objects or indicators during mouse interaction.
public virtual void PostRender(DrawingContext dc)WL9 calls this method after the main rendering phase for the plot object. The default implementation does nothing.
public virtual void PreRender(DrawingContext dc)WL9 calls this method before the main rendering phase for the plot object. The default implementation does nothing.
public abstract void Render(DrawingContext dc)WL9 calls this method when the plot object should render itself to the specified WPF DrawingContext dc. Derived PlotBase classes must implement this method.
public virtual bool RenderEachPassDetermines whether the plot object should render on every applicable chart rendering pass. The default implementation returns false.
public virtual void RenderHighlight(DrawingContext dc)WL9 calls this method when the plot object's mouse-over or highlight state should be rendered to the specified DrawingContext. The default implementation does nothing.
public virtual int RenderPassesSpecifies the chart rendering passes in which the plot object participates. WL9 uses render passes 1, 2, and 4. A derived class can return one pass or combine multiple passes using a bitwise OR. Objects rendered in pass 1 appear beneath those in pass 2, while objects rendered in pass 4 appear above passes 1 and 2. The default implementation returns 4. During rendering, a derived class that participates in multiple passes can inspect the chart's current render pass to determine which pass is being processed.
public void RenderLine( DrawingContext dc, int idx1, double value1, int idx2, double value2, WLColor color, int width = 1, LineStyle lineStyle = LineStyle.Solid)Renders a line between two bar index/value coordinates. The method converts idx1, value1, idx2, and value2 to chart pixel coordinates and obtains an appropriate Pen from PenBrushFactory.
public void RenderRectangle( DrawingContext dc, int idx1, double value1, int idx2, double value2, WLColor color, int width = 1, LineStyle lineStyle = LineStyle.Solid)Renders an unfilled rectangle whose opposite corners are defined by the two supplied bar index/value coordinates. The rectangle outline uses the specified color, width, and lineStyle.
public void RenderText( DrawingContext dc, string txt, int idx, double value, bool aboveBar, WLColor color, double xOffset = 0.0, double yOffset = 0.0, bool center = true)public void RenderText( DrawingContext dc, string txt, double x, double y, bool aboveBar, WLColor color, double xOffset = 0.0, double yOffset = 0.0, bool center = true)public void RenderText( DrawingContext dc, string txt, double x, double y, bool aboveBar, WLColor color, WLColor colorBkg, double xOffset = 0.0, double yOffset = 0.0, bool center = true, int fontSize = 10)Renders text to the specified DrawingContext. The first overload accepts a bar index and data value and converts them to chart pixel coordinates. The second overload accepts x and y pixel coordinates directly. The third overload also renders a background rectangle behind the text using colorBkg and allows the font size to be specified. When center is true, the text is horizontally centered on the supplied x coordinate. When aboveBar is true, the text is shifted upward by its rendered height. The optional xOffset and yOffset values provide additional pixel positioning adjustments.
Ask the community or explore custom development services.