Javascript 要删除highcharts图形标签前面的此项目符号吗
我用的是海图实心量具。下面是我创建的示例 现在我想删除这些灰色的子弹,因为它们不会出现在我的本地版本中,但在测试中,我并没有从api中得到任何帮助。这里有一些选项。因此,我不确定我遗漏了什么。当我尝试查找solid gauge的api时,是否有人可以指导我,但我不确定哪一个选项可以帮助我Javascript 要删除highcharts图形标签前面的此项目符号吗,javascript,vue.js,highcharts,Javascript,Vue.js,Highcharts,我用的是海图实心量具。下面是我创建的示例 现在我想删除这些灰色的子弹,因为它们不会出现在我的本地版本中,但在测试中,我并没有从api中得到任何帮助。这里有一些选项。因此,我不确定我遗漏了什么。当我尝试查找solid gauge的api时,是否有人可以指导我,但我不确定哪一个选项可以帮助我 options() { return { credits: { enabled: false }, chart: { type: "solidgauge",
options() {
return {
credits: {
enabled: false
},
chart: {
type: "solidgauge",
},
title: {
text: "",
style: {
fontSize: "24px"
}
},
legend: {
layout: "horizontal",
align: "right",
itemDistance: 100,
verticalAlign: "middle",
itemMarginTop: 5,
itemStyle: {
fontSize: "28px",
},
itemMarginBottom: 5,
labelFormatter: function() {
const formattedTotal = Number(
this.userOptions.data[0].total
).toLocaleString("en-US", {
minimumFractionDigits: 0,
maximumFractionDigits: 0
});
return (
'<span style="text-weight:bold;color:' +
this.userOptions.data[0].color +
'">' +
this.name +
'</span><br/><span style="text-align: center">' +
formattedTotal +
"</span>"
);
},
symbolWidth: 0
},
tooltip: {
borderWidth: 0,
backgroundColor: "none",
shadow: false,
style: {
fontSize: "16px"
},
useHTML: true,
pointFormat:
'<table><tr><td style="text-align: center"><span style="font-size: 14px">{series.name}</span><br><span style="font-size:22px; color: {point.color}; font-weight: bold">{point.y}%</span></td></tr></table>',
positioner: function(labelWidth) {
return {
x: (this.chart.chartWidth - labelWidth - 600) / 2,
y: this.chart.plotHeight / 2 - 15
};
}
},
pane: {
startAngle: 0,
endAngle: 360,
background: [
{
// Track for Move
outerRadius: "112%",
innerRadius: "88%",
backgroundColor: Highcharts.Color(this.graphColors && this.graphColors[0])
.setOpacity(0.3)
.get(),
borderWidth: 0
},
{
// Track for Exercise
outerRadius: "87%",
innerRadius: "63%",
backgroundColor: Highcharts.Color(this.graphColors && this.graphColors[1])
.setOpacity(0.3)
.get(),
borderWidth: 0
},
{
// Track for Stand
outerRadius: "62%",
innerRadius: "38%",
backgroundColor: Highcharts.Color(this.graphColors && this.graphColors[2])
.setOpacity(0.3)
.get(),
borderWidth: 0
}
]
},
yAxis: {
min: 0,
max: 100,
lineWidth: 0,
tickPositions: [],
},
plotOptions: {
solidgauge: {
dataLabels: {
enabled: false,
},
linecap: "round",
stickyTracking: false,
rounded: true
}
},
series: [
{
name: "Passerby",
showInLegend: true,
data: [
{
color: this.graphColors && this.graphColors[0],
radius: "112%",
innerRadius: "88%",
y: this.passerby,
total: this.passerbyTotal
}
]
},
{
name: "Visitor",
showInLegend: true,
data: [
{
color: this.graphColors && this.graphColors[1],
radius: "87%",
innerRadius: "63%",
y: this.visitor,
total: this.visitorTotal,
}
]
},
{
name: "Connected",
showInLegend: true,
data: [
{
color: this.graphColors && this.graphColors[2],
radius: "62%",
innerRadius: "38%",
y: this.connected,
total: this.connectedTotal
}
]
}
],
}
}
options(){
返回{
学分:{
已启用:false
},
图表:{
类型:“solidgauge”,
},
标题:{
正文:“,
风格:{
字体大小:“24px”
}
},
图例:{
布局:“水平”,
对齐:“右”,
项目距离:100,
垂直排列:“中间”,
项目编号:5,
项目样式:{
字体大小:“28px”,
},
项目MarginBottom:5,
labelFormatter:function(){
const formattedTotal=Number(
此.userOptions.data[0]。总计
).toLocaleString(“en US”{
最小分数位数:0,
最大分数位数:0
});
返回(
'' +
这个名字+
“
”+
格式总计+
""
);
},
符号宽度:0
},
工具提示:{
边框宽度:0,
背景颜色:“无”,
影子:错,
风格:{
字体大小:“16px”
},
是的,
点格式:
“{series.name}
{point.y}%”,
定位器:功能(标签宽度){
返回{
x:(this.chart.chartWidth-labelWidth-600)/2,
y:this.chart.plotHeight/2-15
};
}
},
窗格:{
startAngle:0,
端角:360,
背景:[
{
//行踪
外层:“112%”,
内半径:“88%”,
背景颜色:Highcharts.Color(this.graphColors&&this.graphColors[0])
.setOpacity(0.3)
.get(),
边框宽度:0
},
{
//运动跑道
外层:“87%”,
内半径:“63%”,
背景色:Highcharts.Color(this.graphColors&&this.graphColors[1])
.setOpacity(0.3)
.get(),
边框宽度:0
},
{
//看台轨道
外层:“62%”,
内半径:“38%”,
背景色:Highcharts.Color(this.graphColors&&this.graphColors[2])
.setOpacity(0.3)
.get(),
边框宽度:0
}
]
},
亚克斯:{
分:0,,
最高:100,
线宽:0,
职位:[],
},
打印选项:{
solidgauge:{
数据标签:{
启用:false,
},
线头:“圆形”,
粘滞跟踪:错误,
四舍五入:对
}
},
系列:[
{
姓名:“过路人”,
showInLegend:是的,
数据:[
{
颜色:this.graphColors&&this.graphColors[0],
半径:“112%”,
内半径:“88%”,
y:这个,路人,
总计:这个。过路人总计
}
]
},
{
姓名:“访客”,
showInLegend:是的,
数据:[
{
颜色:this.graphColors&&this.graphColors[1],
半径:“87%”,
内半径:“63%”,
y:这位,客人,
总计:本次访问总计,
}
]
},
{
名称:“已连接”,
showInLegend:是的,
数据:[
{
颜色:this.graphColors&&this.graphColors[2],
半径:“62%”,
内半径:“38%”,
y:这个,连起来了,
总计:此。已连接总计
}
]
}
],
}
}
我认为您可以对highcharts创建的类应用样式来隐藏这些标记:
.highcharts-legend-item rect {
display: none;
}
我认为您可以对highcharts创建的类应用样式来隐藏这些标记:
.highcharts-legend-item rect {
display: none;
}
我不熟悉高图表,但这些项目符号看起来像是
元素的工作
您可以使用css从所有ul
元素中删除项目符号,如下所示:
ul
{
list-style-type:none;
}
看。当然,最好指定特定
ul
元素的#id
,但是(上面)只是一个示例。我不熟悉
,但这些项目符号看起来像
元素的工作
您可以使用css从所有ul
元素中删除项目符号,如下所示:
ul
{
list-style-type:none;
}
看。当然,最好指定特定
ul
元素的#id
,但是(上面)只是一个示例。不可能删除图例符号并保留序列标记。作为一种解决方法,您可以在图表load
事件回调中手动删除它们
代码:
chart: {
type: "solidgauge",
events: {
load: function() {
var chart = this,
series = chart.series;
series.forEach(function(serie, i) {
if (serie.legendSymbol) {
serie.legendSymbol.destroy()
}
});
}
}
}
演示:
chart: {
type: "solidgauge",
events: {
load: function() {
var chart = this,
series = chart.series;
series.forEach(function(serie, i) {
if (serie.legendSymbol) {
serie.legendSymbol.destroy()
}
});
}
}
}
chart: {
type: "solidgauge",
events: {
load: function() {
var chart = this,
series = chart.series;
series.forEach(function(serie, i) {
if (serie.legendSymbol) {
serie.legendSymbol.destroy()
}
});
}
}
}
load
事件回调中手动删除它们
代码:
chart: {
type: "solidgauge",
events: {
load: function() {
var chart = this,
series = chart.series;
series.forEach(function(serie, i) {
if (serie.legendSymbol) {
serie.legendSymbol.destroy()
}
});
}
}
}
演示:
chart: {
type: "solidgauge",
events: {
load: function() {
var chart = this,
series = chart.series;
series.forEach(function(serie, i) {
if (serie.legendSymbol) {
serie.legendSymbol.destroy()
}
});
}
}
}
chart: {
type: "solidgauge",
events: {
load: function() {
var chart = this,
series = chart.series;
series.forEach(function(serie, i) {
if (serie.legendSymbol) {
serie.legendSymbol.destroy()
}
});
}
}
}