Class LegendModifier
Defines a custom chart modifier which shows a Legend on the SciChartSurface and also can provide a data-source via LegendModifier#setSourceMode(SourceMode) property
Inheritance
Inherited Members
Namespace:
Assembly: .dll
Syntax
public class LegendModifier extends ChartModifierBase
Constructors
LegendModifier(Context context)
Creates a new instance of LegendModifier class
Declaration
public LegendModifier(Context context)
Parameters
Type | Name | Description |
---|---|---|
android.content.Context | context | The context of the application |
LegendModifier(SciChartLegend legend)
Creates a new instance of LegendModifier class
Declaration
public LegendModifier(SciChartLegend legend)
Parameters
Type | Name | Description |
---|---|---|
SciChartLegend | legend | The SciChartLegend instance which should be used by this modifier |
LegendModifier(SciChartLegend legend, boolean useAutoPlacement)
Creates a new instance of LegendModifier class
Declaration
public LegendModifier(SciChartLegend legend, boolean useAutoPlacement)
Parameters
Type | Name | Description |
---|---|---|
SciChartLegend | legend | The SciChartLegend instance which should be used by this modifier |
boolean | useAutoPlacement | If true modifier will try to place legend inside chart, otherwise legend is already placed somewhere and shouldn't be moved |
LegendModifier(SciChartLegend legend, SeriesInfoLegendAdapter legendAdapter, boolean useAutoPlacement)
Creates a new instance of LegendModifier class
Declaration
public LegendModifier(SciChartLegend legend, SeriesInfoLegendAdapter legendAdapter, boolean useAutoPlacement)
Parameters
Type | Name | Description |
---|---|---|
SciChartLegend | legend | The SciChartLegend instance which should be used by this modifier |
SeriesInfoLegendAdapter | legendAdapter | The SeriesInfoLegendAdapter instance which should be used by legend |
boolean | useAutoPlacement | If true modifier will try to place legend inside chart, otherwise legend is already placed somewhere and shouldn't be moved |
Methods
applyThemeProvider(IThemeProvider themeProvider)
Applies specified theme to current instance
Declaration
public void applyThemeProvider(IThemeProvider themeProvider)
Parameters
Type | Name | Description |
---|---|---|
IThemeProvider | themeProvider |
Overrides
attachTo(IServiceContainer serviceContainer)
Declaration
public void attachTo(IServiceContainer serviceContainer)
Parameters
Type | Name | Description |
---|---|---|
IServiceContainer | serviceContainer |
Overrides
detach()
Declaration
public void detach()
Overrides
isSeriesValid(renderableSeries.IRenderableSeries series)
When overridden in derived classes, indicates whether the series should be inspected in order to get SeriesInfo
Declaration
protected boolean isSeriesValid(renderableSeries.IRenderableSeries series)
Parameters
Type | Name | Description |
---|---|---|
renderableSeries.IRenderableSeries | series | The renderable series to check |
Returns
Type | Description |
---|---|
boolean | True if renderable series is valid |
onRenderSurfaceRendered(RenderedMessage message)
Called when parent SciChartSurface#getRenderSurface() rendered
Declaration
public void onRenderSurfaceRendered(RenderedMessage message)
Parameters
Type | Name | Description |
---|---|---|
RenderedMessage | message |
Overrides
onRenderableSeriesCollectionChanged(CollectionChangedEventArgs<? extends renderableSeries.IRenderableSeriesCore> args)
Called when RenderableSeries changes
Declaration
public void onRenderableSeriesCollectionChanged(CollectionChangedEventArgs<? extends renderableSeries.IRenderableSeriesCore> args)
Parameters
Type | Name | Description |
---|---|---|
CollectionChangedEventArgs<? extends com.scichart.charting.visuals.renderableSeries.IRenderableSeriesCore> | args |
Overrides
onRenderableSeriesDrasticallyChanged()
Called when RenderableSeries collection drastically changed
Declaration
public void onRenderableSeriesDrasticallyChanged()
Overrides
onSelectedSeriesCollectionChanged(CollectionChangedEventArgs<? extends renderableSeries.IRenderableSeriesCore> args)
Called when SelectedSeries collection changes
Declaration
public void onSelectedSeriesCollectionChanged(CollectionChangedEventArgs<? extends renderableSeries.IRenderableSeriesCore> args)
Parameters
Type | Name | Description |
---|---|---|
CollectionChangedEventArgs<? extends com.scichart.charting.visuals.renderableSeries.IRenderableSeriesCore> | args |
Overrides
provideSeriesForLegend()
When overridden in derived classes, should provide array of series which will be used as legend data source
Declaration
protected List<renderableSeries.IRenderableSeries> provideSeriesForLegend()
Returns
Type | Description |
---|---|
List<IRenderableSeries> | Array of series for the legend data source. |
setLegendPosition(int gravity, int margin)
Sets the position of the current LegendModifier instance.
Declaration
public void setLegendPosition(int gravity, int margin)
Parameters
Type | Name | Description |
---|---|---|
int | gravity | The LegendModifier#sciChartLegend gravity for this modifier. |
int | margin | The margin size for all sides (left, top, right, bottom). |
setLegendPosition(int gravity, int leftMargin, int topMargin, int rightMargin, int bottomMargin)
Sets the position of the current LegendModifier instance.
Declaration
public void setLegendPosition(int gravity, int leftMargin, int topMargin, int rightMargin, int bottomMargin)
Parameters
Type | Name | Description |
---|---|---|
int | gravity | The LegendModifier#sciChartLegend gravity for this modifier. |
int | leftMargin | The left margin size. |
int | topMargin | The top margin size. |
int | rightMargin | The right margin size. |
int | bottomMargin | The bottom margin size. |
setOrientation(int orientation)
Sets the orientation of the legend
Declaration
public final void setOrientation(int orientation)
Parameters
Type | Name | Description |
---|---|---|
int | orientation | The orientation of legend |
setShowCheckboxes(boolean showCheckboxes)
Sets whether the legend should display checkboxes
Declaration
public final void setShowCheckboxes(boolean showCheckboxes)
Parameters
Type | Name | Description |
---|---|---|
boolean | showCheckboxes | The new showCheckboxes value |
setShowLegend(boolean showLegend)
Sets whether the legend should be displayed
Declaration
public final void setShowLegend(boolean showLegend)
Parameters
Type | Name | Description |
---|---|---|
boolean | showLegend | The new showLegend value |
setShowSeriesMarkers(boolean showSeriesMarkers)
Sets whether the legend should display series markers
Declaration
public final void setShowSeriesMarkers(boolean showSeriesMarkers)
Parameters
Type | Name | Description |
---|---|---|
boolean | showSeriesMarkers | The new showSeriesMarkers value |
setSourceMode(SourceMode sourceMode)
Sets the SourceMode value for legend
Declaration
public final void setSourceMode(SourceMode sourceMode)
Parameters
Type | Name | Description |
---|---|---|
SourceMode | sourceMode | The new SourceMode value |
updateLegend()
Refreshes content of the legend with up-to-date values
Declaration
public void updateLegend()