GaugeChart

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

1 2 3 4 5 6 7 8 9 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

 

Properties

 

GreenColor, YellowColor, RedColor

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

1 2 3 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.

1 this.gaugeChart.setYellowFrom(75);

GreenTo, YellowTo, RedTo

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

1 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.

1 this.gaugeChart.setMajorTicks(Arrays.asList("10", "20", "30"));

MinorTicks

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

1 this.gaugeChart.setMinorTicks(5);

AnimationDuration

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

1 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.

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