应用一些主题后,如何将我的主题恢复为 Highcharts 中的默认主题?
我试过这个但没有用。
Highcharts.theme = {
};
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
我也尝试了这里描述的解决方案
从下面的代码中删除所有颜色选项并重新加载 Highcharts 对象将使其默认为基本主题
...但它也不起作用。
谢谢
应用一些主题后,如何将我的主题恢复为 Highcharts 中的默认主题?
我试过这个但没有用。
Highcharts.theme = {
};
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
我也尝试了这里描述的解决方案
从下面的代码中删除所有颜色选项并重新加载 Highcharts 对象将使其默认为基本主题
...但它也不起作用。
谢谢
不幸的是,您需要用第二张图表的默认值覆盖所有颜色/参数。
var theme = {
colors: ['#2f7ed8', '#0d233a', '#8bbc21', '#910000', '#1aadce', '#492970',
'#f28f43', '#77a1e5', '#c42525', '#a6c96a'],
chart: {
backgroundColor: '#fff',
borderWidth: 0,
plotBackgroundColor: '#fff',
plotShadow: false,
plotBorderWidth: 0
},
title: {
style: {
color: '#274b6d',//#3E576F',
fontSize: '16px'
}
},
subtitle: {
style: {
color: '#4d759e'
}
},
xAxis: {
gridLineWidth: 0,
lineColor: '#C0D0E0',
tickColor: '#C0D0E0',
labels: {
style: {
color: '#666',
cursor: 'default',
fontSize: '11px',
lineHeight: '14px'
}
},
title: {
style: {
color: '#4d759e',
fontWeight: 'bold'
}
}
},
yAxis: {
minorTickInterval: null,
lineColor: '#C0D0E0',
lineWidth: 1,
tickWidth: 1,
tickColor: '#C0D0E0',
labels: {
style: {
color: '#666',
cursor: 'default',
fontSize: '11px',
lineHeight: '14px'
}
},
title: {
style: {
color: '#4d759e',
fontWeight: 'bold'
}
}
},
legend: {
itemStyle: {
color: '#274b6d',
fontSize: '12px'
},
itemHoverStyle: {
color: '#000'
},
itemHiddenStyle: {
color: '#CCC'
}
},
labels: {
style: {
color: '#3E576F'
}
},
navigation: {
buttonOptions: {
theme: {
stroke: '#CCCCCC'
}
}
}
};