I am defining my gauge as:
items: {
xtype: 'polar',
itemId: 'gauge',
store: me.store,
title: 'polar title',
legend: {
docked: 'bottom'
},
series: {
type: 'gauge',
title: 'Avg',
YField: 'loadavg',
label: {
display: 'under',
field: 'loadavg'
},
needle: true,
showInLegend: true,
minimum: 100,
maximum: 800,
field: 'loadavg',
donut: 50,
colors: ['#3AA8CB', '#ddd']
}
}
I am trying to change the title with the following code (form a load callback):
var data = this.store.first();
var cpuValue = data.get(this.chartConfig.series.field);
// Get the series title.
var chart = this.chart.getComponent('gauge');
var series = chart.getSeries()[0]; // only 1 series, so get first one.
var title = series.getTitle();
// Append the display value to the title.
series.setTitle(title + ': ' + cpuValue + "%");
setTitle error for a gauge series polar chart
Aucun commentaire:
Enregistrer un commentaire