Chart
struct · ferroui-controls-livecharts · v0.5.0
struct Chart
Shared host for all chart families. All application state stays on the UI thread.
Members
TYPEto_refconstructnewrevisionlast_errorinvalidate_chartscenefind_pointsmove_pointerclear_hoverhover_changeddata_pointer_downupdate_finishedzoom_atpan_byzoom_to_sectionreset_zoomaxis_scalespolar_scalescale_data_to_pixelsscale_pixels_to_datapresentation_scenezoom_levelpan_offsetmap_viewportset_viewportpan_mapzoom_mapreset_viewportrotate_toprojectunprojectfind_land_atmap_landchart_kind_propertyseries_propertyx_axes_propertyy_axes_propertytitle_propertytitle_size_propertytext_color_propertylegend_position_propertytooltip_position_propertytooltip_finding_strategy_propertytooltip_tolerance_propertyzoom_mode_propertyzooming_speed_propertyanimations_speed_propertydraw_margin_propertysections_propertyinitial_rotation_propertymax_angle_propertyinner_radius_propertyfit_to_bounds_propertymin_value_propertymax_value_propertyclockwise_propertyactive_map_propertymap_projection_propertymin_latitude_propertymax_latitude_propertymin_longitude_propertymax_longitude_propertyinteraction_mode_propertymin_zoom_level_propertymax_zoom_level_propertystroke_propertyfill_propertycenter_longitude_propertycenter_latitude_propertymarkers_propertyvisual_elements_propertychart_kindset_chart_kindseriesset_seriesx_axesset_x_axesy_axesset_y_axestitleset_titletitle_sizeset_title_sizetext_colorset_text_colorlegend_positionset_legend_positiontooltip_positionset_tooltip_positiontooltip_finding_strategyset_tooltip_finding_strategytooltip_toleranceset_tooltip_tolerancezoom_modeset_zoom_modezooming_speedset_zooming_speedanimations_speedset_animations_speeddraw_marginset_draw_marginsectionsset_sectionsinitial_rotationset_initial_rotationmax_angleset_max_angleinner_radiusset_inner_radiusfit_to_boundsset_fit_to_boundsmin_valueset_min_valuemax_valueset_max_valueclockwiseset_clockwiseactive_mapset_active_mapmap_projectionset_map_projectionmin_latitudeset_min_latitudemax_latitudeset_max_latitudemin_longitudeset_min_longitudemax_longitudeset_max_longitudeinteraction_modeset_interaction_modemin_zoom_levelset_min_zoom_levelmax_zoom_levelset_max_zoom_levelstrokeset_strokefillset_fillcenter_longitudeset_center_longitudecenter_latitudeset_center_latitudemarkersset_markersvisual_elementsset_visual_elements
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<Chart>
Returns a strong reference to this object.
construct
fn construct() -> Self
new
fn new() -> Ref<Self>
revision
fn revision(self: &Self) -> u64
last_error
fn last_error(self: &Self) -> Option<String>
invalidate_chart
fn invalidate_chart(self: &Self)
scene
fn scene(self: &Self, size: Size) -> Result<Rc<Scene>, ChartError>
Measures once per data revision and size. The returned scene is an immutable snapshot.
find_points
fn find_points(self: &Self, position: Point) -> Vec<HitRegion>
move_pointer
fn move_pointer(self: &Self, position: Point)
clear_hover
fn clear_hover(self: &Self)
hover_changed
fn hover_changed(self: &Self, handler: impl Fn(&ChartPointerEventArgs) -> () + 'static) -> Rc<dyn IDisposable>
data_pointer_down
fn data_pointer_down(self: &Self, handler: impl Fn(&ChartPointerEventArgs) -> () + 'static) -> Rc<dyn IDisposable>
update_finished
fn update_finished(self: &Self, handler: impl Fn() -> () + 'static) -> Rc<dyn IDisposable>
zoom_at
fn zoom_at(self: &Self, position: Point, factor: f64) -> Result<bool, ChartError>
Zooms about a control-local point. A disabled gesture returns false.
pan_by
fn pan_by(self: &Self, from: Point, to: Point) -> Result<bool, ChartError>
zoom_to_section
fn zoom_to_section(self: &Self, from: Point, to: Point) -> Result<bool, ChartError>
Zooms to the part of the plot selected by a secondary pointer drag. Reversed selections and inverted/logarithmic axes use the same inverse scales.
reset_zoom
fn reset_zoom(self: &Self)
axis_scales
fn axis_scales(self: &Self) -> (Vec<AxisScale>, Vec<AxisScale>)
polar_scale
fn polar_scale(self: &Self, angle_axis: usize, radius_axis: usize) -> Result<Option<PolarScale>, ChartError>
A resolved polar axis pair (PolarScaler): the angle scale maps to degrees, the radius
scale to logical pixels from the centre, which includes the title and legend layout.
None for another chart family or a missing axis.
scale_data_to_pixels
fn scale_data_to_pixels(self: &Self, data: Point, x_axis: usize, y_axis: usize) -> Result<Option<Point>, ChartError>
Converts chart values (X/Y, or angle/radius of a polar chart) into control-local pixels.
A missing axis or a chart family without axes returns None.
scale_pixels_to_data
fn scale_pixels_to_data(self: &Self, point: Point, x_axis: usize, y_axis: usize) -> Result<Option<Point>, ChartError>
Inverse of scale_data_to_pixels, using the current layout and axis limits.
presentation_scene
fn presentation_scene(self: &Self, now_ms: f64, target: Rc<Scene>) -> Rc<Scene>
zoom_level
fn zoom_level(self: &Self) -> f64
The zoom of a map (ZoomLevel), 1 by default.
pan_offset
fn pan_offset(self: &Self) -> Point
The pan of a map (PanOffset), in pixels.
map_viewport
fn map_viewport(self: &Self) -> MapViewport
The pan and zoom of a map.
set_viewport
fn set_viewport(self: &Self, zoom: f64, pan: Point)
Sets the zoom and pan of a map (MapFactory.SetViewport).
pan_map
fn pan_map(self: &Self, delta: Point)
Moves a map by a screen distance (GeoMapChart.Pan), whatever its interaction mode.
zoom_map
fn zoom_map(self: &Self, pivot: Point, direction: ZoomDirection)
One zoom step of a map about a control-local position, which stays in place
(GeoMapChart.Zoom), with the chart's ZoomingSpeed, MinZoomLevel and
MaxZoomLevel, whatever its interaction mode.
reset_viewport
fn reset_viewport(self: &Self)
The zoom and pan of a map back to none (ResetViewport).
rotate_to
fn rotate_to(self: &Self, longitude: f64, latitude: f64, duration_ms: f64)
Turns a globe to face a longitude and latitude, the short way round, over the given time
(RotateTo, 800 ms in the source, quadratic in and out); a duration of 0, or a chart not
in a visual tree, turns it at once. Setting CenterLongitude or CenterLatitude ends
the rotation.
project
fn project(self: &Self, longitude: f64, latitude: f64) -> Result<Option<Point>, ChartError>
The control-local position of a longitude and latitude on a map (GeoMapChart.Project),
through its projection, rotation and viewport; None on the far side of a globe or for
another chart family.
unproject
fn unproject(self: &Self, point: Point) -> Result<Option<(f64, f64)>, ChartError>
The longitude and latitude of a control-local position on a map
(GeoMapChart.Unproject); None outside the disc of a globe or for another chart family.
find_land_at
fn find_land_at(self: &Self, position: Point) -> Option<GeoLand>
The land of a map whose shape contains the position (FindLandAt): its names, the values
of the series that have one and the anchor of its tooltip.
map_land
fn map_land(self: &Self, id: PointId) -> Option<GeoLand>
The land of a point of a map event (ChartPoint.Context.DataSource, a LandDefinition
in the source).
chart_kind_property
fn chart_kind_property() -> &'static StyledProperty<ChartKind>
series_property
fn series_property() -> &'static StyledProperty<ChartSeriesCollection>
x_axes_property
fn x_axes_property() -> &'static StyledProperty<Axes>
y_axes_property
fn y_axes_property() -> &'static StyledProperty<Axes>
title_property
fn title_property() -> &'static StyledProperty<String>
title_size_property
fn title_size_property() -> &'static StyledProperty<f64>
text_color_property
fn text_color_property() -> &'static StyledProperty<Color>
legend_position_property
fn legend_position_property() -> &'static StyledProperty<LegendPosition>
tooltip_position_property
fn tooltip_position_property() -> &'static StyledProperty<TooltipPosition>
tooltip_finding_strategy_property
fn tooltip_finding_strategy_property() -> &'static StyledProperty<FindingStrategy>
tooltip_tolerance_property
fn tooltip_tolerance_property() -> &'static StyledProperty<f64>
zoom_mode_property
fn zoom_mode_property() -> &'static StyledProperty<ZoomAndPanMode>
zooming_speed_property
fn zooming_speed_property() -> &'static StyledProperty<f64>
animations_speed_property
fn animations_speed_property() -> &'static StyledProperty<f64>
draw_margin_property
fn draw_margin_property() -> &'static StyledProperty<Option<Rect>>
sections_property
fn sections_property() -> &'static StyledProperty<Vec<Section>>
initial_rotation_property
fn initial_rotation_property() -> &'static StyledProperty<f64>
max_angle_property
fn max_angle_property() -> &'static StyledProperty<f64>
inner_radius_property
fn inner_radius_property() -> &'static StyledProperty<f64>
fit_to_bounds_property
fn fit_to_bounds_property() -> &'static StyledProperty<bool>
min_value_property
fn min_value_property() -> &'static StyledProperty<f64>
max_value_property
fn max_value_property() -> &'static StyledProperty<Option<f64>>
clockwise_property
fn clockwise_property() -> &'static StyledProperty<bool>
active_map_property
fn active_map_property() -> &'static StyledProperty<Option<Rc<DrawnMap>>>
map_projection_property
fn map_projection_property() -> &'static StyledProperty<MapProjection>
min_latitude_property
fn min_latitude_property() -> &'static StyledProperty<Option<f64>>
max_latitude_property
fn max_latitude_property() -> &'static StyledProperty<Option<f64>>
min_longitude_property
fn min_longitude_property() -> &'static StyledProperty<Option<f64>>
max_longitude_property
fn max_longitude_property() -> &'static StyledProperty<Option<f64>>
interaction_mode_property
fn interaction_mode_property() -> &'static StyledProperty<MapInteractionMode>
min_zoom_level_property
fn min_zoom_level_property() -> &'static StyledProperty<f64>
max_zoom_level_property
fn max_zoom_level_property() -> &'static StyledProperty<f64>
stroke_property
fn stroke_property() -> &'static StyledProperty<Option<Color>>
fill_property
fn fill_property() -> &'static StyledProperty<Option<Color>>
center_longitude_property
fn center_longitude_property() -> &'static StyledProperty<f64>
center_latitude_property
fn center_latitude_property() -> &'static StyledProperty<f64>
markers_property
fn markers_property() -> &'static StyledProperty<GeoMarkers>
visual_elements_property
fn visual_elements_property() -> &'static StyledProperty<ChartVisualElements>
chart_kind
fn chart_kind(self: &Self) -> ChartKind
set_chart_kind
fn set_chart_kind(self: &Self, value: ChartKind)
series
fn series(self: &Self) -> ChartSeriesCollection
set_series
fn set_series(self: &Self, value: ChartSeriesCollection)
x_axes
fn x_axes(self: &Self) -> Axes
set_x_axes
fn set_x_axes(self: &Self, value: Axes)
y_axes
fn y_axes(self: &Self) -> Axes
set_y_axes
fn set_y_axes(self: &Self, value: Axes)
title
fn title(self: &Self) -> String
set_title
fn set_title(self: &Self, value: String)
title_size
fn title_size(self: &Self) -> f64
set_title_size
fn set_title_size(self: &Self, value: f64)
text_color
fn text_color(self: &Self) -> Color
set_text_color
fn set_text_color(self: &Self, value: Color)
legend_position
fn legend_position(self: &Self) -> LegendPosition
set_legend_position
fn set_legend_position(self: &Self, value: LegendPosition)
tooltip_position
fn tooltip_position(self: &Self) -> TooltipPosition
set_tooltip_position
fn set_tooltip_position(self: &Self, value: TooltipPosition)
tooltip_finding_strategy
fn tooltip_finding_strategy(self: &Self) -> FindingStrategy
set_tooltip_finding_strategy
fn set_tooltip_finding_strategy(self: &Self, value: FindingStrategy)
tooltip_tolerance
fn tooltip_tolerance(self: &Self) -> f64
set_tooltip_tolerance
fn set_tooltip_tolerance(self: &Self, value: f64)
zoom_mode
fn zoom_mode(self: &Self) -> ZoomAndPanMode
set_zoom_mode
fn set_zoom_mode(self: &Self, value: ZoomAndPanMode)
zooming_speed
fn zooming_speed(self: &Self) -> f64
set_zooming_speed
fn set_zooming_speed(self: &Self, value: f64)
animations_speed
fn animations_speed(self: &Self) -> f64
set_animations_speed
fn set_animations_speed(self: &Self, value: f64)
draw_margin
fn draw_margin(self: &Self) -> Option<Rect>
set_draw_margin
fn set_draw_margin(self: &Self, value: Option<Rect>)
sections
fn sections(self: &Self) -> Vec<Section>
set_sections
fn set_sections(self: &Self, value: Vec<Section>)
initial_rotation
fn initial_rotation(self: &Self) -> f64
set_initial_rotation
fn set_initial_rotation(self: &Self, value: f64)
max_angle
fn max_angle(self: &Self) -> f64
set_max_angle
fn set_max_angle(self: &Self, value: f64)
inner_radius
fn inner_radius(self: &Self) -> f64
set_inner_radius
fn set_inner_radius(self: &Self, value: f64)
fit_to_bounds
fn fit_to_bounds(self: &Self) -> bool
set_fit_to_bounds
fn set_fit_to_bounds(self: &Self, value: bool)
min_value
fn min_value(self: &Self) -> f64
set_min_value
fn set_min_value(self: &Self, value: f64)
max_value
fn max_value(self: &Self) -> Option<f64>
set_max_value
fn set_max_value(self: &Self, value: Option<f64>)
clockwise
fn clockwise(self: &Self) -> bool
set_clockwise
fn set_clockwise(self: &Self, value: bool)
active_map
fn active_map(self: &Self) -> Option<Rc<DrawnMap>>
set_active_map
fn set_active_map(self: &Self, value: Option<Rc<DrawnMap>>)
map_projection
fn map_projection(self: &Self) -> MapProjection
set_map_projection
fn set_map_projection(self: &Self, value: MapProjection)
min_latitude
fn min_latitude(self: &Self) -> Option<f64>
set_min_latitude
fn set_min_latitude(self: &Self, value: Option<f64>)
max_latitude
fn max_latitude(self: &Self) -> Option<f64>
set_max_latitude
fn set_max_latitude(self: &Self, value: Option<f64>)
min_longitude
fn min_longitude(self: &Self) -> Option<f64>
set_min_longitude
fn set_min_longitude(self: &Self, value: Option<f64>)
max_longitude
fn max_longitude(self: &Self) -> Option<f64>
set_max_longitude
fn set_max_longitude(self: &Self, value: Option<f64>)
interaction_mode
fn interaction_mode(self: &Self) -> MapInteractionMode
set_interaction_mode
fn set_interaction_mode(self: &Self, value: MapInteractionMode)
min_zoom_level
fn min_zoom_level(self: &Self) -> f64
set_min_zoom_level
fn set_min_zoom_level(self: &Self, value: f64)
max_zoom_level
fn max_zoom_level(self: &Self) -> f64
set_max_zoom_level
fn set_max_zoom_level(self: &Self, value: f64)
stroke
fn stroke(self: &Self) -> Option<Color>
set_stroke
fn set_stroke(self: &Self, value: Option<Color>)
fill
fn fill(self: &Self) -> Option<Color>
set_fill
fn set_fill(self: &Self, value: Option<Color>)
center_longitude
fn center_longitude(self: &Self) -> f64
set_center_longitude
fn set_center_longitude(self: &Self, value: f64)
center_latitude
fn center_latitude(self: &Self) -> f64
set_center_latitude
fn set_center_latitude(self: &Self, value: f64)
markers
fn markers(self: &Self) -> GeoMarkers
set_markers
fn set_markers(self: &Self, value: GeoMarkers)
visual_elements
fn visual_elements(self: &Self) -> ChartVisualElements
set_visual_elements
fn set_visual_elements(self: &Self, value: ChartVisualElements)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherControlImplExtDerefUpcast<T>Upcast<Chart>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplInteractiveImplFerroObjectImplControlImplLayoutableImplVisualImplInputElementImplDrop
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.