Rod*_*ney 7 javascript kendo-ui kendo-mobile kendo-dataviz bullet-chart
试图将Bullet图表设计为与营销愿望完全一致.所需的Graph看起来像:

如何在条形图的顶部添加标签?
我试过设置Kendo文档中的labels属性:
labels:
{
visible: true,
format: "{0}",
font: "14px Arial",
},
Run Code Online (Sandbox Code Playgroud)
这是我的脚本不起作用:
$barChart = $("#bar-chart").empty();
$barChart.kendoChart({
theme: global.app.chartsTheme,
renderAs: "svg",
legend: {
position: "bottom"
},
seriesDefaults: {
type: "column"
},
series: [
{
type: "verticalBullet",
currentField: "score",
targetField: "average",
target: {
color: "#444",
dashType: "dot",
line: {
width: 1,
}
},
labels:
{
visible: true,
format: "{0}",
font: "14px Arial",
},
data: [
{
score: 93.7,
average: 65.2,
}, {
score: 80.2,
average: 22.2,
}, {
score: 60.8,
average: 35.2,
}, {
score: 82.1,
average: 45.2,
}, {
score: 74.2,
average: 55.2,
}
]
}
],
categoryAxis: {
labels: { rotation: -45 },
categories: ["Sales & Contracting", "Implementation & Training", "Functionality & Upgrades", "Service & Support", "General"],
line: {
visible: false
},
color: "#444",
axisCrossingValue: [0, 0, 100, 100]
},
tooltip: {
visible: false
}
}).data("kendoChart");
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激.
因为这不是受支持的功能,所以任何这样做的尝试本质上都是黑客行为。我查看了 kendo demo,注意到有一个带有 k-tooltip 类的工具提示元素,其中包含鼠标悬停时栏的总数。您应该查看鼠标悬停以显示总数。
| 归档时间: |
|
| 查看次数: |
1202 次 |
| 最近记录: |