Javascript 在devextremecharts(dxChart)中同时显示系列标签和值
我使用的是具有模块化概念的devextreme图表(js图表) 在我的一个条形图中,我希望显示一个工具提示,悬停时显示序列条的名称及其值。 即 让我们假设我的图表有3个条形图,描绘了美国、英国、法国的人口。 当我悬停在美国(酒吧)我想我的工具提示显示Javascript 在devextremecharts(dxChart)中同时显示系列标签和值,javascript,jquery,devexpress,devextreme,Javascript,Jquery,Devexpress,Devextreme,我使用的是具有模块化概念的devextreme图表(js图表) 在我的一个条形图中,我希望显示一个工具提示,悬停时显示序列条的名称及其值。 即 让我们假设我的图表有3个条形图,描绘了美国、英国、法国的人口。 当我悬停在美国(酒吧)我想我的工具提示显示 USA:10000 英国和法国也是如此 $("#myChartDiv").dxChart({ dataSource: dataset, commonSeriesSettings: {
USA:10000
英国和法国也是如此
$("#myChartDiv").dxChart({
dataSource: dataset,
commonSeriesSettings: {
argumentField: 'DimensionValue',
valueField: 'MetricValue',
label: {
visible: true,
format: {
type: "fixedPoint",
precision: Barnumberprecision
}
},
type: 'bar',
},
seriesTemplate: {
nameField: "SurveyYear",
},
valueAxis: {
title: {
text: Title
},
position: "left"
},
argumentAxis: {
label: {
overlappingBehavior: { mode: Barlabeloverlappingmode, rotationAngle: Barlabelrotateangle }
}
},
tooltip: {
enabled: true,
location: "edge",
customizeText: function () {
return this.seriesName;
},
format: {
//type: "fixedPoint",
precision: Barnumberprecision
}
},
legend: {
verticalAlignment: BarlegendverticalAlignment,
horizontalAlignment: BarlegendhorizontalAlignment
}
});
我浏览了devextreme网站,但没有发现任何对我有影响的财产,或者可能是我没有正确使用它。有人能告诉我哪个属性满足我的要求吗?我建议您浏览文档,在那里您可以找到可以用来显示特定值的属性名称 请参阅此DX线程:
我建议您仔细阅读文档,在那里您将找到可用于显示特定值的属性名称 请参阅此DX线程:
tooltip: {
enabled: true,
customizeTooltip: function (point) {
return {
text: point.value+' of '+point.argument+' against '+point.seriesName
}
}
}