相关文章推荐
不拘小节的荒野  ·  如何在调用WCF服务之前弹出一个确认对话框? ...·  1 年前    · 
旅行中的柳树  ·  关于#vba#的问题,如何解决?(关键词-批 ...·  2 年前    · 
拉风的蟠桃  ·  JS判断字符串长度(英文占1个字符,中文汉字 ...·  2 年前    · 
爱旅游的铁链  ·  论文速览:三维点云的表示与生成模型_生成三维 ...·  2 年前    · 
豪气的瀑布  ·  安全系列之——主流Hash散列算法介绍和使用 ...·  2 年前    · 
Code  ›  Highcharts始终隐藏重置缩放按钮开发者社区
label 按钮 highcharts chart
https://cloud.tencent.com/developer/ask/sof/1907059/answer/2592268
细心的南瓜
2 年前
首页
学习
活动
专区
工具
TVP
返回腾讯云官网
提问
问 Highcharts始终隐藏重置缩放按钮
Stack Overflow用户
提问于 2017-07-02 19:10:52
EN

如何在highcharts中始终隐藏重置缩放按钮。我有用于放大和缩小的自定义按钮。如何在highcharts中始终隐藏重置缩放按钮。我有用于放大和缩放out.How的自定义按钮,以便始终隐藏highcharts中的重置缩放按钮。我有用于放大和缩放out.How的自定义按钮,以便始终隐藏highcharts中的重置缩放按钮。我有用于放大和缩小的自定义按钮。$(function() { /** *一个Highcharts插件,用于在图表的*边界框外的单独容器中显示工具提示,以便它可以利用页面中的所有可用空间。*/

(function(H) {
    H.wrap(H.Tooltip.prototype, 'getLabel', function(proceed) {
        var chart = this.chart,
            options = this.options,
            chartRenderer = chart.renderer,
        if (!this.label) {
            this.renderer = new H.Renderer(document.body, 400, 500);
            box = this.renderer.boxWrapper;
            box.css({
                position: 'absolute',
                top: '-9999px'
            chart.renderer = this.renderer;
            proceed.call(this, chart, options);
            chart.renderer = chartRenderer;
            this.label.attr({
                x: 0,
            this.label.xSetter = function(value) {
                box.element.style.left = value + 'px';
            this.label.ySetter = function(value) {
                box.element.style.top = value + 'px';
        return this.label;
    H.wrap(H.Tooltip.prototype, 'getPosition', function(proceed, boxWidth, boxHeight, point) {
        var chart = this.chart,
            chartWidth = chart.chartWidth,
            chartHeight = chart.chartHeight,
        point.plotX += this.chart.pointer.chartPosition.left;
        point.plotY += this.chart.pointer.chartPosition.top;
        // Temporary set the chart size to the full document, so that the tooltip positioner picks it up
        chart.chartWidth = $(document).width();
        chart.chartHeight = $(document).height();
        // Compute the tooltip position
        pos = proceed.call(this, boxWidth, boxHeight, point);
        // Reset chart size
        chart.chartWidth = chartWidth;
        chart.chartHeight = chartHeight;
        return pos;
     * Find the new position and perform the move. This override is identical
     * to the core function, except the anchorX and anchorY arguments to move().
    H.Tooltip.prototype.updatePosition = function(point) {
        var chart = this.chart,
            label = this.label,
            pos = (this.options.positioner || this.getPosition).call(
                this,
                label.width,
                label.height,
                point
        // do the move
        this.move(
            Math.round(pos.x),
            Math.round(pos.y || 0), // can be undefined (#3977)
            point.plotX + chart.plotLeft - pos.x,
            point.plotY + chart.plotTop - pos.y
}(Highcharts));
    let data = [{
        values: [
        name: "#1"
        values: [
            0.0, -1.0
        name: "#2"
        values: [
        name: "#3"
        values: [-1.0,
        name: "#4"
        values: [
        name: "#5"
    let chart = Highcharts.chart('container', {
        chart: {
            type: 'line',
            height: 45,
            style: {
                overflow: 'visible'
        xAxis: {
            minPadding: 0.000,
            maxPadding: 0.000,
            startOnTick: false,
            endOnTick: false,
            tickWidth: 0,
            gridLineWidth: 0,
            lineWidth: 0,
            labels: {
                enabled: false
            title: {
                text: null
        yAxis: {
            minPadding: 0.001,
            maxPadding: 0.001,
            gridLineWidth: 0,
            lineWidth: 0,
            labels: {
                enabled: false
            title: {
                text: null
        lang: {
            noData: 'No data'
        credits: {
            enabled: false
        legend: {
            enabled: false
        exporting: {
            enabled: false
        title: {
            text: ''
        tooltip: {
            shared: true
        plotOptions: {
            series: {
                marker: {
                    enabled: false
        series: [{
            data: []
    data.forEach((seriesData) => {
        chart.addSeries({
            name: seriesData.name,
            data: seriesData.values
}); 
2 1.1K 0 票数 0
EN
highcharts

Stack Overflow用户

发布于 2021-06-26 23:53:27

可以将按钮的CSS display 属性设置为 none 。

chart1 = new Highcharts.Chart({
    chart: {
        type: 'line',
        zoomType: 'x',
        renderTo: 'chart',
        resetZoomButton: {
            theme: { style: { display: 'none'} }
 
推荐文章
不拘小节的荒野  ·  如何在调用WCF服务之前弹出一个确认对话框? - Artech - 博客园
1 年前
旅行中的柳树  ·  关于#vba#的问题,如何解决?(关键词-批量复制粘贴)-编程语言-CSDN问答
2 年前
拉风的蟠桃  ·  JS判断字符串长度(英文占1个字符,中文汉字占2个字符)-阿里云开发者社区
2 年前
爱旅游的铁链  ·  论文速览:三维点云的表示与生成模型_生成三维点云文献、_冯子材的博客-CSDN博客
2 年前
豪气的瀑布  ·  安全系列之——主流Hash散列算法介绍和使用 - 腾讯云开发者社区-腾讯云
2 年前
今天看啥   ·   Py中国   ·   codingpro   ·   小百科   ·   link之家   ·   卧龙AI搜索
删除内容请联系邮箱 2879853325@qq.com
Code - 代码工具平台
© 2024 ~ 沪ICP备11025650号