Versions Compared

Key

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

...

Inhalt:

  • Füllen von Daten

  • Properties

Allgemein

Detailierte Information finden Sie zusätzlich hier: https://developers.google.com/chart/interactive/docs/gallery/gauge

Beispiel: Füllen der Daten

Code Block
languagejava
final ChartModel model = ChartModel.New()
	.addColumn(Column.New(Column.Type.STRING, "label"))
	.addColumn(Column.New(Column.Type.NUMBER, "value"));

model.addRow("Memory", 80);
model.addRow("CPU", 55);
model.addRow("Network", 68);

this.gaugeChart.setModel(model);

API und Methoden:

Properties

GreenColor, YellowColor, RedColor

The color to use for the green, yellow, red section, in HTML color notation.

Code Block
languagejava
this.gaugeChart.setYellowColor("yellow");
this.gaugeChart.setYellowColor("#526846");
this.gaugeChart.setYellowColor("red");

GreenFrom, YellowFrom, RedFrom

The lowest value for a range marked by a green, yellow, red color.

Code Block
languagejava
this.gaugeChart.setYellowFrom(75);

GreenTo, YellowTo, RedTo

The highest value for a range marked by a green, yellow, red color.

Code Block
languagejava
this.gaugeChart.setYellowTo(90);

MajorTicks

Labels for major tick marks. The number of labels define the number of major ticks in all gauges. The default is five major ticks, with the labels of the minimal and maximal gauge value.

Code Block
languagejava
this.gaugeChart.setMajorTicks(Arrays.asList("10", "20", "30"));

MinorTicks

The number of minor tick section in each major tick section.

Code Block
this.gaugeChart.setMinorTicks(5);

AnimationDuration

The duration of the animation, in milliseconds. For details, see the animation documentation.

Code Block
this.gaugeChart.setAnimation(Animation.New(2000));

AnimationEasing

The easing function applied to the animation. The following options are available:

  • 'linear' - Constant speed.

  • 'in' - Ease in - Start slow and speed up.

  • 'out' - Ease out - Start fast and slow down.

  • 'inAndOut' - Ease in and out - Start slow, speed up, then slow down.

Code Block
this.gaugeChart.setAnimation(Animation.New(2000, Easing.LINEAR));