DefaultFormat: String;
DefaultFormat: string;
The DefaultFormat property determines legend number format.
Legend numbers have the following format: #,####0.0000.
Executing the example requires that the repository contains an express report with a map. Change legend number format.
Place the Button, UiErAnalyzer, EaxMapBox components named Button1, UiErAnalyzer1 and EaxMapBox1 correspondingly on the form. For UiErAnalyzer select the Active property to True, OperationMode to Edit and select the express report in the Object property. For EaxMapBox select the UiErAnalyzer1 component in the Source property (Analyzer for Fore.NET).
Add links to the system assemblies: Express, Forms, Visualizators (for Fore.NET example add links to the Metabase and Forms.NET system assemblies).
The example is the OnClick event handler for the Button1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Analyzer: IEaxAnalyzer;
Map: IVZMapChart;
Legend: IVZLegendBase;
Begin
Map := UiErAnalyzer1.ErAnalyzer.MapChart.MapChart;
// Get map legend
Legend := Map.Legends.Item(0);
// Determine a new format of legend number
Legend.DefaultFormat := "#,####0.0000";
// Refresh map after changes
UiErAnalyzer1.ErAnalyzer.Map.Refresh;
End Sub Button1OnClick;
After clicking the button, the legend number format changes to the four decimal points.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Forms;
Imports Prognoz.Platform.Interop.Visualizators;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Analyzer: IEaxAnalyzer;
Map: IVZMapChart;
Legend: IVZLegendBase;
Begin
Map := uiErAnalyzerNet1.ErAnalyzer.ErAnalyzer.MapChart.MapChart;
// Get map legend
Legend := Map.Legends.Item[0];
// Determine a new format of legend number
Legend.DefaultFormat := "#,####0.0000";
// Refresh map after changes
uiErAnalyzerNet1.ErAnalyzer.ErAnalyzer.Map.Refresh();
End Sub;
See also: