我想為每一天開發(fā)一個帶有徑向折線圖的“月歷”視圖 - 每天顯示不同的數(shù)據(jù)。現(xiàn)在我只用了3天,只是想試試它是如何工作的。問題是這些圖被附加到以前的 svg 上,并且它們應(yīng)該只在每個圖的一個單獨的 svg 中呈現(xiàn)一次。這是生成圖表的組件: https ://pastebin.com/hzRwNhNh 這是日歷組件:https ://pastebin.com/m6qd1z3m日歷組件現(xiàn)在有 3 個圖表組件:<CalendarRadial currentDay={'2017-03-03'} dataDayHours={dataParser.getDayHoursArr(this.props.monthData, '2017-03-03')} dayInsights={this.props.monthData} lineType={this.props.lineType} clockConfig={this.props.clockConfig} /> <CalendarRadial currentDay={'2017-03-04'} dataDayHours={dataParser.getDayHoursArr(this.props.monthData, '2017-03-04')} dayInsights={this.props.monthData} lineType={this.props.lineType} clockConfig={this.props.clockConfig} /> <CalendarRadial currentDay={'2017-03-05'} dataDayHours={dataParser.getDayHoursArr(this.props.monthData, '2017-03-05')} dayInsights={this.props.monthData} lineType={this.props.lineType} clockConfig={this.props.clockConfig} />我認為問題出在渲染 svg 時。這是示例道具的樣子(這部分應(yīng)該是正確的):
React + d3 具有不同數(shù)據(jù)的多個圖表組件
拉風的咖菲貓
2022-01-13 15:23:24