Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ReactNative Fusionchart许可证配置不工作_Javascript_Reactjs_React Native_Fusioncharts_License Key - Fatal编程技术网

Javascript ReactNative Fusionchart许可证配置不工作

Javascript ReactNative Fusionchart许可证配置不工作,javascript,reactjs,react-native,fusioncharts,license-key,Javascript,Reactjs,React Native,Fusioncharts,License Key,我尝试在ReactNative中配置Fusionchart的许可证,就像在这个URL中一样 但是,它仍然显示了不应该可见的水印。有什么我错过的吗 import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, Platform } from 'react-native'; import ReactNativeFusionCharts from 'react-native-fusionc

我尝试在ReactNative中配置Fusionchart的许可证,就像在这个URL中一样

但是,它仍然显示了不应该可见的水印。有什么我错过的吗

import React, { Component } from 'react';
import { AppRegistry, StyleSheet, Text, View, Platform } from 'react-native';
import ReactNativeFusionCharts from 'react-native-fusioncharts';


global.licenseConfig = {
    key: "license-key",
    creditLabel: false // true/false to show/hide watermark respectively
};

export default class App extends Component {
    constructor(props) {
        super(props);
        //STEP 2 - Chart Data
        const chartData = [
            { label: 'Venezuela', value: '250' },
            { label: 'Saudi', value: '260' },
            { label: 'Canada', value: '180' },
            { label: 'Iran', value: '140' },
            { label: 'Russia', value: '115' },
            { label: 'UAE', value: '100' },
            { label: 'US', value: '30' },
            { label: 'China', value: '30' },
        ];
        //STEP 3 - Chart Configurations
        const chartConfig = {
            type: 'column2d',
            width: 400,
            height: 400,
            dataFormat: 'json',
            dataSource: {
                chart: {
                    caption: 'Countries With Most Oil Reserves [2017-18]',
                    subCaption: 'In MMbbl = One Million barrels',
                    xAxisName: 'Country',
                    yAxisName: 'Reserves (MMbbl)',
                    numberSuffix: 'K',
                    theme: 'fusion',
                    exportEnabled: 1, // to enable the export chart functionality
                },
                data: chartData,
            },
        };
        const events = {
            // Add your events method here:
            // Event name should be in small letters.
            dataPlotClick: (ev, props) => {
                console.log('dataPlotClick');
            },
            dataLabelClick: (ev, props) => {
                console.log('dataLabelClick');
            },
        };
        this.state = {
            chartConfig,
            events
        };
    }

    render() {
        return (
            <View style={styles.container}>
                <Text style={styles.heading}>FusionCharts Integration with React Native</Text>
                <View style={styles.chartContainer}>
                    <ReactNativeFusionCharts chartConfig={this.state.chartConfig} events={this.state.events} />
                </View>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        paddingTop: 50,
        height: 500,
        backgroundColor: 'white'
    },
    heading: {
        fontSize: 20,
        textAlign: 'center',
        marginBottom: 10,
    },
    chartContainer: {
        borderColor: 'red',
        borderWidth: 1,
        height: 500,
    },
});

// skip this line if using Create React Native App
 AppRegistry.registerComponent('ReactNativeFusionCharts', () => App);

回答我自己的问题。希望这将有助于某人

问题是fusionchart 5.0.0未更新为fusionchart 3.17.0。您可能需要手动复制fusionchart内容以响应本机fusionchart

node\u module/fusionchart
内容复制到
node\u modules/react native fusioncharts/src/modules/fusionchart
文件夹中,然后在脚本下方运行

find fusioncharts -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.fcscript"' {} \;
然后水印会像预期的那样消失。这些步骤是在gulp脚本中配置的,但不知何故它似乎不起作用

希望这个问题能尽快解决

find fusioncharts -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.fcscript"' {} \;