pub struct VisualMap {
pub visual_type: VisualMapType,
pub min: f64,
pub max: f64,
pub colors: Vec<Color>,
pub split_number: usize,
pub pieces: Vec<VisualPiece>,
pub out_of_range: Option<Color>,
}Expand description
A visual map, resolved for drawing.
A visual map turns a value into a colour. The chart resolves the option once, and then asks the map for the colour of every value it draws — which is what keeps a map of a country from walking the palette for every region.
Fields§
§visual_type: VisualMapTypeThe kind of the visual map.
min: f64The lowest value the map covers.
max: f64The highest value the map covers.
colors: Vec<Color>The colours of the map, from the lowest value to the highest.
split_number: usizeThe number of bands a piecewise map is cut into.
pieces: Vec<VisualPiece>The bands of a piecewise map, when the option names them.
out_of_range: Option<Color>The colour of the values outside the range.
Implementations§
Source§impl VisualMap
Inherent implementation of VisualMap.
impl VisualMap
Inherent implementation of VisualMap.
Sourcepub fn resolve(option: &VisualMapOption, values: &[f64]) -> Self
pub fn resolve(option: &VisualMapOption, values: &[f64]) -> Self
Resolves a visual map option against the values it applies to.
The range of the map is the range of the values, unless the option names one. The colours are the ones the option names, or the ones ECharts falls back to.
§Arguments
&VisualMapOption- Shared reference to aVisualMapOption.&[f64]- Shared reference to a[f64].