如何隐藏 kendo jquery 图表值轴单位标签
How to hide kendo jquery chart value axis unit labels
我正在尝试使用 kendo jquery 图表绘制折线图,其中值轴和类别轴将在某个点相交。
我在 kendo 论坛上跟进了这个问题 https://www.telerik.com/forums/dynamic-vertical-line-in-charts
我选择创建多个价值轴。到目前为止,我能够绘制如下图所示的图形,但无法从左侧的值轴上删除单位标签。
任何人都可以帮助解决如何从蓝色值轴中删除 单位标签 或任何更好的方法吗?
示例代码如下:
function drawChart(data) {
var series = [
{
name: "Series1",
color: "#96DF73",
markers: {
visible: false
},
data: data.Series1
},
{
color: "#00B0F2",
width: 4,
markers: {
visible: false
},
data: Array.from({ length: 8 }).fill(3.2)
}
];
$("#divChart").kendoChart({
legend: {
position: "top"
},
seriesDefaults: {
type: "line",
style: "smooth",
tooltip: {
visible: true
},
axis: "defaultCatAxis"
},
chartArea: {
background: "#f1f1f1"
},
plotArea: {
background: "white"
},
series: multiSpeedSeries,
categoryAxis: {
title: {
text: "Category"
},
categories: [0, 1000, 2000, 4000, 6000, 8000, 10000, 12000],
axisCrossingValues: [0, 5],
justified: true,
minorGridLines: {
visible: true
}
},
valueAxes: [
{
name: "defaultCatAxis",
title: {
text: "defaultCatAxis"
},
minorGridLines: {
visible: true
},
min: 1
},
{
labels: {
//width: 3,
visibility: false
},
line: {
color: "#00B0F2",
width: 4
}
}
]
});
}
你的代码几乎与你做标签的方式一样,它只是一些 typos
和 属性 定义:
示例参见 dojo:dojo.telerik。com/otuBehiq/2
我所做的只是更正您的轴定义:
{
labels: {
//width: 3,
visibility: false
},
line: {
color: "#00B0F2",
width: 4
}
}
至:
{
labels: {
//width: 3,
visible:false
},
line: {
color: '#00B0F2',
width: 4,
}
}
注意它是 visible
而不是 visibility
至于你在评论中问题的第二部分,你需要扩展图表中的实际内容 need/expect 因为它不清楚,因为我已经从中删除了次要值和网格线图表。
我正在尝试使用 kendo jquery 图表绘制折线图,其中值轴和类别轴将在某个点相交。
我在 kendo 论坛上跟进了这个问题 https://www.telerik.com/forums/dynamic-vertical-line-in-charts
我选择创建多个价值轴。到目前为止,我能够绘制如下图所示的图形,但无法从左侧的值轴上删除单位标签。
任何人都可以帮助解决如何从蓝色值轴中删除 单位标签 或任何更好的方法吗?
示例代码如下:
function drawChart(data) {
var series = [
{
name: "Series1",
color: "#96DF73",
markers: {
visible: false
},
data: data.Series1
},
{
color: "#00B0F2",
width: 4,
markers: {
visible: false
},
data: Array.from({ length: 8 }).fill(3.2)
}
];
$("#divChart").kendoChart({
legend: {
position: "top"
},
seriesDefaults: {
type: "line",
style: "smooth",
tooltip: {
visible: true
},
axis: "defaultCatAxis"
},
chartArea: {
background: "#f1f1f1"
},
plotArea: {
background: "white"
},
series: multiSpeedSeries,
categoryAxis: {
title: {
text: "Category"
},
categories: [0, 1000, 2000, 4000, 6000, 8000, 10000, 12000],
axisCrossingValues: [0, 5],
justified: true,
minorGridLines: {
visible: true
}
},
valueAxes: [
{
name: "defaultCatAxis",
title: {
text: "defaultCatAxis"
},
minorGridLines: {
visible: true
},
min: 1
},
{
labels: {
//width: 3,
visibility: false
},
line: {
color: "#00B0F2",
width: 4
}
}
]
});
}
你的代码几乎与你做标签的方式一样,它只是一些 typos
和 属性 定义:
示例参见 dojo:dojo.telerik。com/otuBehiq/2
我所做的只是更正您的轴定义:
{
labels: {
//width: 3,
visibility: false
},
line: {
color: "#00B0F2",
width: 4
}
}
至:
{
labels: {
//width: 3,
visible:false
},
line: {
color: '#00B0F2',
width: 4,
}
}
注意它是 visible
而不是 visibility
至于你在评论中问题的第二部分,你需要扩展图表中的实际内容 need/expect 因为它不清楚,因为我已经从中删除了次要值和网格线图表。