public class LegendModifier extends ChartModifierBase
SciChartSurface
and also can provide a data-source via setSourceMode(SourceMode)
propertyservices
Constructor 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,
boolean useAutoPlacement)
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<? extends IRenderableSeriesCore> args)
Called when RenderableSeries changes
|
void |
onRenderableSeriesDrasticallyChanged()
Called when RenderableSeries collection drastically changed
|
void |
onRenderSurfaceRendered(RenderedMessage message)
Called when parent
SciChartSurface.getRenderSurface() rendered |
void |
onSelectedSeriesCollectionChanged(com.scichart.core.observable.CollectionChangedEventArgs<? extends IRenderableSeriesCore> args)
Called when SelectedSeries 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, getMasterModifier, getModifierSurface, getParentSurface, getPointRelativeTo, getRenderableSeries, getRenderableSeriesArea, getXAxes, getXAxis, getXAxis, getYAxes, getYAxis, getYAxis, isWithinSourceBounds, onAnnotationsCollectionChanged, onAnnotationsDrasticallyChanged, onParentSurfaceResized, onXAxesCollectionChanged, onXAxesDrasticallyChanged, onYAxesCollectionChanged, onYAxesDrasticallyChanged
checkPointerCounter, getEventsGroupTag, getIsEnabled, getReceiveHandledEvents, getServices, isAttached, onGenericMotion, onIsEnabledChanged, onTouch, setEventsGroupTag, setIsEnabled, setReceiveHandledEvents
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEventsGroupTag, getIsEnabled, setIsEnabled
public LegendModifier(android.content.Context context)
LegendModifier
classcontext
- The context of the applicationpublic LegendModifier(SciChartLegend legend)
LegendModifier
classlegend
- The SciChartLegend
instance which should be used by this modifierpublic LegendModifier(SciChartLegend legend, boolean useAutoPlacement)
LegendModifier
classlegend
- The SciChartLegend
instance which should be used by this modifieruseAutoPlacement
- If true modifier will try to place legend inside chart, otherwise legend is already placed somewhere and shouldn't be movedpublic LegendModifier(SciChartLegend legend, 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 ChartModifierCore
themeProvider
- The IThemeProvider
instance which provides new theme for current instancepublic void attachTo(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<? extends IRenderableSeriesCore> args)
ChartModifierCore
onRenderableSeriesCollectionChanged
in interface IRenderableSeriesChangeListener
onRenderableSeriesCollectionChanged
in class ChartModifierCore
args
- The collection changed event argspublic void onRenderableSeriesDrasticallyChanged()
ChartModifierCore
onRenderableSeriesDrasticallyChanged
in interface IRenderableSeriesChangeListener
onRenderableSeriesDrasticallyChanged
in class ChartModifierCore
public void onSelectedSeriesCollectionChanged(com.scichart.core.observable.CollectionChangedEventArgs<? extends IRenderableSeriesCore> args)
ChartModifierCore
onSelectedSeriesCollectionChanged
in interface IRenderableSeriesChangeListener
onSelectedSeriesCollectionChanged
in class ChartModifierCore
args
- The collection changed event argspublic void updateLegend()
protected boolean isSeriesValid(IRenderableSeries series)
SeriesInfo
series
- The renderable series to check