public class LegendModifier extends ChartModifierBase
SciChartSurface
and also can provide a data-source via setSourceMode(SourceMode)
propertyConstructor and Description |
---|
LegendModifier(android.content.Context context)
Creates a new instance of
LegendModifier class |
LegendModifier(SciChartLegend legend)
Creates a new instance of
LegendModifier class |
LegendModifier(SciChartLegend legend,
SeriesInfoLegendAdapter legendAdapter,
boolean useAutoPlacement)
Creates a new instance of
LegendModifier class |
Modifier and Type | Method and Description |
---|---|
void |
applyThemeProvider(IThemeProvider themeProvider)
Applies specified theme to current instance
|
void |
attachTo(com.scichart.core.IServiceContainer serviceContainer) |
void |
detach() |
protected boolean |
isSeriesValid(IRenderableSeries series)
When overridden in derived classes, indicates whether the series should be inspected in order to get
SeriesInfo |
void |
onRenderableSeriesCollectionChanged(com.scichart.core.observable.CollectionChangedEventArgs<IRenderableSeries> args)
Called when parent
SciChartSurface.getRenderableSeries() collection changes |
void |
onRenderableSeriesDrasticallyChanged(ISciChartSurface surface)
Called when parent
SciChartSurface.getRenderableSeries() collection drastically changed |
void |
onRenderSurfaceRendered(RenderedMessage message)
Called when parent
SciChartSurface.getRenderSurface() rendered |
void |
onSelectedSeriesCollectionChanged(com.scichart.core.observable.CollectionChangedEventArgs<IRenderableSeries> args)
Called when parent
SciChartSurface.getSelectedRenderableSeries() collection changes |
void |
setLegendPosition(int gravity,
int margin)
Sets the position of the current
LegendModifier instance. |
void |
setLegendPosition(int gravity,
int leftMargin,
int topMargin,
int rightMargin,
int bottomMargin)
Sets the position of the current
LegendModifier instance. |
void |
setOrientation(int orientation)
Sets the orientation of the legend
|
void |
setShowCheckboxes(boolean showCheckboxes)
Sets whether the legend should display checkboxes
|
void |
setShowLegend(boolean showLegend)
Sets whether the legend should be displayed
|
void |
setShowSeriesMarkers(boolean showSeriesMarkers)
Sets whether the legend should display series markers
|
void |
setSourceMode(SourceMode sourceMode)
Sets the
SourceMode value for legend |
void |
updateLegend()
Refreshes content of the legend with up-to-date values
|
getContext, getEventsGroupTag, getIsEnabled, getMasterModifier, getModifierSurface, getParentSurface, getPointRelativeTo, getReceiveHandledEvents, getRenderableSeries, getRenderableSeriesArea, getServices, getXAxes, getXAxis, getXAxis, getYAxes, getYAxis, getYAxis, isAttached, isWithinSourceBounds, onAnnotationsCollectionChanged, onAnnotationsDrasticallyChanged, onGenericMotion, onIsEnabledChanged, onParentSurfaceResized, onTouch, onXAxesCollectionChanged, onXAxesDrasticallyChanged, onYAxesCollectionChanged, onYAxesDrasticallyChanged, setEventsGroupTag, setIsEnabled, setReceiveHandledEvents
public LegendModifier(@NonNull android.content.Context context)
LegendModifier
classcontext
- The context of the applicationpublic LegendModifier(@NonNull SciChartLegend legend)
LegendModifier
classlegend
- The SciChartLegend
instance which should be used by this modifierpublic LegendModifier(@NonNull SciChartLegend legend, @NonNull SeriesInfoLegendAdapter legendAdapter, boolean useAutoPlacement)
LegendModifier
classlegend
- The SciChartLegend
instance which should be used by this modifierlegendAdapter
- The SeriesInfoLegendAdapter
instance which should be used by legenduseAutoPlacement
- If true modifier will try to place legend inside chart, otherwise legend is already placed somewhere and shouldn't be movedpublic void setLegendPosition(int gravity, int margin)
LegendModifier
instance.gravity
- The sciChartLegend
gravity for this modifier.margin
- The margin size for all sides (left, top, right, bottom).public void setLegendPosition(int gravity, int leftMargin, int topMargin, int rightMargin, int bottomMargin)
LegendModifier
instance.gravity
- The sciChartLegend
gravity for this modifier.leftMargin
- The left margin size.topMargin
- The top margin size.rightMargin
- The right margin size.bottomMargin
- The bottom margin size.public final void setOrientation(int orientation)
orientation
- The orientation of legendpublic final void setShowLegend(boolean showLegend)
showLegend
- The new showLegend valuepublic final void setShowCheckboxes(boolean showCheckboxes)
showCheckboxes
- The new showCheckboxes valuepublic final void setShowSeriesMarkers(boolean showSeriesMarkers)
showSeriesMarkers
- The new showSeriesMarkers valuepublic final void setSourceMode(SourceMode sourceMode)
SourceMode
value for legendsourceMode
- The new SourceMode
valuepublic void applyThemeProvider(IThemeProvider themeProvider)
applyThemeProvider
in interface IThemeable
applyThemeProvider
in class ChartModifierBase
themeProvider
- The IThemeProvider
instance which provides new theme for current instancepublic void attachTo(@NonNull com.scichart.core.IServiceContainer serviceContainer)
attachTo
in interface com.scichart.core.framework.IAttachable
attachTo
in class ChartModifierBase
public void detach()
detach
in interface com.scichart.core.framework.IAttachable
detach
in class ChartModifierBase
public void onRenderSurfaceRendered(RenderedMessage message)
SciChartSurface.getRenderSurface()
renderedonRenderSurfaceRendered
in interface ISciChartSurfaceChangeListener
onRenderSurfaceRendered
in class ChartModifierBase
message
- The rendered messagepublic void onRenderableSeriesCollectionChanged(com.scichart.core.observable.CollectionChangedEventArgs<IRenderableSeries> args)
ChartModifierBase
SciChartSurface.getRenderableSeries()
collection changesonRenderableSeriesCollectionChanged
in interface ISciChartSurfaceChangeListener
onRenderableSeriesCollectionChanged
in class ChartModifierBase
args
- The collection changed event argspublic void onRenderableSeriesDrasticallyChanged(ISciChartSurface surface)
ChartModifierBase
SciChartSurface.getRenderableSeries()
collection drastically changedonRenderableSeriesDrasticallyChanged
in interface ISciChartSurfaceChangeListener
onRenderableSeriesDrasticallyChanged
in class ChartModifierBase
surface
- The parent surfacepublic void onSelectedSeriesCollectionChanged(com.scichart.core.observable.CollectionChangedEventArgs<IRenderableSeries> args)
ChartModifierBase
SciChartSurface.getSelectedRenderableSeries()
collection changesonSelectedSeriesCollectionChanged
in interface ISciChartSurfaceChangeListener
onSelectedSeriesCollectionChanged
in class ChartModifierBase
args
- The collection changed event argspublic void updateLegend()
protected boolean isSeriesValid(IRenderableSeries series)
SeriesInfo
series
- The renderable series to check