Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Inhalt:

Achtung: Für die Verwendung der XdevGeoChart oder XdevMapChart ist ein Google API-Key erforderlich. Dieser API-Key kann hier angefordert werden.

...

Code Block
languagejava
themeEclipse
firstline1
linenumberstrue
XdevGeoChartModelfinal ChartModel model = new XdevGeoChartModel("Country"ChartModel.New()
.addColumn(Column.New(Column.Type.STRING, "Country"))
.addColumn(Column.New(Column.Type.NUMBER, "Popularity"));

model.addItemaddRow("United StatesGermany", 327414000200);
model.addItemaddRow("JapanUnited States", 126490000300);
model.addItemaddRow("RussiaBrazil", 146877088400);
model.addItemaddRow("BotswanaCanada", 2304238500);
model.addItemaddRow("AustraliaFrance", 24985600600);
model.addItemaddRow("CanadaRU", 37153100700);

API und Methoden:

Properties
API Key

For some charts a API Key from Goofle is nessesary. You can get a key here: https://developers.google.com/maps/documentation/javascript/get-api-key

Code Block
languagejava
themeEclipse


DatalessRegionColor

Color to assign to regions with no associated data.

Code Block
languagejava
themeEclipse
C


DefaultColor

The color to use when for data points in a geochart when the location (e.g., 'US' ) is present but the value is either null or unspecified. This is distinct from datalessRegionColor, which is the color used when data is missing.

Code Block
languagejava
themeEclipse
Comb


DisplayMode

Which type of geochart this is. The DataTable format must match the value specified. The following values are supported:

  • 'auto' - Choose based on the format of the DataTable.
  • 'regions' - Color the regions on the geochart.
  • 'markers' - Place markers on the regions.
  • 'text' - Label the regions with text from the DataTable.
MarkerOpacy

The opacity of the markers, where 0.0 is fully transparent and 1.0 is fully opaque.

Code Block
languagejava
themeEclipse
Comb


Resolution

The resolution of the geochart borders. Choose one of the following values:

  • 'countries' - Supported for all regions, except for US state regions.
  • 'provinces' - Supported only for country regions and US state regions. Not supported for all countries; please test a country to see whether this option is supported.
  • 'metros' - Supported for the US country region and US state regions only.
Code Block
languagejava
themeEclipse
jj


MagnifyingGlass

If true, when the user lingers over a cluttered marker, a magnifiying glass will be opened.

Note: this feature is not supported in browsers that do not support SVG, i.e. Internet Explorer version 8 or earlier.

Code Block
languagejava
themeEclipse
geoChart.setMagnifyingGlass(MagnifyingGlass.New(true, 5));


Füllen der Daten

Code Block
languagejava
themeEclipse
firstline1
titlemodel.addItem(String value, String value2, Integer value3)
linenumberstrue
model.addItemaddRow("United States", 327414000);

//Parameter 1 ("United States"): Ein valider Länder- oder Städtename
//Parameter 2 (327414000): Benötigter Wert z.B. Einwohner

...

Code Block
languagejava
themeEclipse
firstline1
titlemodel.addItem(String value, String value2, Integer value3)
linenumberstrue
XdevGeoChartConfig config = new XdevGeoChartConfig();

//"world" - Ein Chart welches die gesamte Welt anzeigt
//Ein Kontinent oder Subkontinent, definiert über den 3 stelligen Ländercode z.B. "011" für Western Africa.
//Ein Land, definiert über seinen ISO 3166-1 alpha-2, z.B. "AU" für Australien.
config.setRegion("world");

//"auto" - Wählt den Mode automatisch auf Basis der Daten
//"regions" - Färbt die jeweiligen Region ein
//"markers" - Setzt Markierungen auf die Karte
//"text" - Beschriftung der Region mit Werten aus der Storage
config.setDisplayMode("regions"); //

...

Code Block
languagejava
themeEclipse
firstline1
linenumberstrue
XdevGeoChartConfig config = new XdevGeoChartConfig();

config.setBackgroundColor(...); //Siehe API Allgemein "BackgroundStyle"

config.setDatalessRegionColor("Red"); //Nicht berücksichtigte Länder oder Regionen werden mit dieser Farbe gekennzeichnet
config.setDefaultColor("White"); //Berücksichtigte Regionen oder Länder die keine explizite Farbe zugewiesen haben bekommen diese Farbe

//Eine Liste an Farben die dann der Reihe nach an die Kategorien vergeben werden
List<String> places = Arrays.asList("#FFFFFF", "Red", "#F4g6uz");
config.setColors(places); //Zuweisen der Farbliste