Reference: How to mimize the tooltips displayed in the chart
The chart prompt information can be customized and displayed when you hover your mouse over the chart or click a chart. You can also set it to not display the prompt content. For specific code, refer to the following settings.
Click the chart to display the prompt information:
This. UltraChart1.Tooltips. Display = Infragistics. UltraChart. Shared. Styles. TooltipDisplay. MouseClick;
The following message is displayed when hovering:
This. UltraChart1.Tooltips. Display = Infragistics. UltraChart. Shared. Styles. TooltipDisplay. MouseMove;
No prompt is displayed:
This. UltraChart1.Tooltips. Display = Infragistics. UltraChart. Shared. Styles. TooltipDisplay. Never;
When you set the cursor to appear when the chart is suspended, the prompt content can be the axis label value and data value, or set it to the row and column number and data value, or customize the prompt content. Refer to the following code:
Show axis label value and data value:
This. UltraChart1.Tooltips. Format = Infragistics. UltraChart. Shared. Styles. TooltipStyle. LabelPlusDataValue;
Show row and column numbers and data values:
This. UltraChart1.Tooltips. Format = Infragistics. UltraChart. Shared. Styles. TooltipStyle. RowColumnPlusDataValue;
Custom chart prompt content:
This. UltraChart1.Tooltips. Format = Infragistics. UltraChart. Shared. Styles. TooltipStyle. Custom;
This. ultrachart1.tooltips. formatstring = "tooltip ";
We have mentioned several settings for customizing the prompt information in the chart. In fact, we can also control the appearance of the prompt information, including the background color, font size, and text color. refer to the following code:
This. ultrachart1.tooltips. backcolor = system. Drawing. color. Yellow;
This. ultrachart1.tooltips. fontcolor = system. Drawing. color. blue;
This. ultrachart1.tooltips. bordercolor = system. Drawing. color. Red;
This. ultrachart1.tooltips. borderthickness = 3;
For the final result, see Figure 1.
Figure 1 user-defined chart prompt demonstration effect