【问题标题】:react & highcharts: add navigation buttonreact & highcharts:添加导航按钮
【发布时间】:2021-03-16 15:22:32
【问题描述】:

如何在highcharts中添加导航按钮以进行react?

该代码适用于标准 Highcharts(尽管需要使用其他模块/导出)。

但是当我开始使用 react 和 highcharts 进行反应时,按钮消失了。

import { Component } from 'react';

import Highcharts from 'highcharts';
import HighchartsReact from 'highcharts-react-official';

class IChartCustom extends Component {

    constructor(props: any) {
        super(props);

        this.state.options = {

            navigation: {
                buttonOptions: {
                    enabled:                    true,

                    align:                      'right',
                    verticalAlign:              'bottom',
                },
            },
        };
    }

    render() {    
        return (
            <HighchartsReact highcharts = {Highcharts} options = {this.state.options} />
        );
    }
}

export default IChartCustom;

请告诉我要在代码中添加什么以使导航按钮出现

【问题讨论】:

    标签: reactjs react-native highcharts navigation


    【解决方案1】:

    决定:)

    import HC_exporting from 'highcharts/modules/exporting'
    
    ...
    
    HC_exporting(Highcharts);
    

    【讨论】:

      猜你喜欢
      • 2014-08-29
      • 2018-07-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多