2017-06-12 15 views

回答

1

如果你不使用的AnyChart的組件實例屬性 - 所有屬性(除了保留)將在圖表上被調用,就好像它是一個JS API(see component usage)。所以,如果你想轉學分了,學分屬性設置爲false: <AnyChart credits={false} />(的chart.credits(false)當量)

+0

沒有任何運氣實現這一點,從我能從我需要的文檔中獲得的東西除此之外添加許可證,但我沒有任何運氣:' robstarbuck

+0

請在渲染組件之前添加'anychart.licenseKey(yourKey)'。例如,在導入部分之後,包含anychart組件(從'anychart-react''導入AnyChart) –

0

您可以訪問AnyChart的實例,然後調用函數積分,看起來像:

componentDidMount() { 
 
    const credits = this.anyChart.instance.credits(); 
 
    credits.enabled(false); 
 
} 
 
    
 
render() { 
 
    return <AnyChart ref={(ref) => { this.anyChart = ref; }} />; 
 
}

+0

它肯定是一個解決方案,我希望有一種使用組件上的屬性的方法。也無法在無狀態組件上實現這一點。 – robstarbuck

+0

預配置實例如何?你可以在那裏配置你的信用。參考: https://github.com/anychart/anychart-react/blob/master/examples/src/simple_dashboard.js –

0

只要把下面的到你的CSS:

.anychart-credits { 
    display: none; 
}