MicroXYChart
How to control the display and hiding of legend by code? (Not by hovering the mouse)
MicroXYChart
How to control the display and hiding of legend by code? (Not by hovering the mouse)
Hello,
Micro charts don't have a legend but full Charts do (you posted this in the full Charts forum). Micro charts do have a tooltip that shows as you mouse over data values.
The legend in full Charts is the box that lists the series names and can be controlled with the XYChart.IsLegendvisible property.
But based on your question of mouse hovering (if you mean full Charts), perhaps you mean data point label display instead? Each series has a LabelVisibility property that you can use to set several options like Visible (always) or PointerAxis (mouse-related).
<microcharts:MicroXYChart IsHotTrackingEnabled="True" BorderThickness="0.5" YAxisMinimum="0" YAxisMaximum="100" XAxisMinimum="0" BorderBrush="Gray">
<microcharts:MicroAreaSeries ItemsSource="{Binding Points}" XPath="CollectTime" YPath="Value1" StackKind="None" LegendStringFormat="{}{5}: Total: {0:N2}%" LineKind="Normal"/>
<microcharts:MicroAreaSeries ItemsSource="{Binding Points}" XPath="CollectTime" YPath="Value2" StackKind="None" LegendStringFormat="{}{5}: Process: {0:N2}% {1:HH\:mm\:ss}" LineKind="Normal"/>
</microcharts:MicroXYChart>
-----------------------------------------------------------------------------------------------------------------------------------------------------
Is it possible to? Somehow dynamically display the LegendString(data point label) in the figure through coding, with the position and content to display dynamically controlled by specifying the value of XAxis in the code Note: Not to display the top content by hovering over the chart
Hello,
Thank you for the clarification. Unfortunately not, the micro charts don't show a legend inline with the control itself since they are intended to be very small graphs that fit in grid cells. They only show legend-like information in the hot-tracking tooltip if enabled.
Is it possible to?How to do?
Call MicroXYChartPlotter.StartHotTracking()/UpdateHotTracking() through coding.
The hot-tracking tooltip is only opened during mouse enter events over the control and once opened, it is updated as mouse move and leave events are raised. There isn't really any public programmatic access to it.
If you are looking to always display a legend, then perhaps it would be better to use full size Charts intead of Micro Charts?
full size Charts? (charts:XYChart?)
Yes, the XYChart control in the full-size Charts product is what I mean.
Please log in to a validated account to post comments.