为了账号安全,请及时绑定邮箱和手机立即绑定

为g元素添加属性无效

import React from 'react';

import * as d3 from 'd3'


import './Dthree.css'


class Dthree extends React.Component{

constructor(props){

super(props)

this.useD3 = this.useD3.bind(this)

}

componentDidMount(){

this.useD3()

}

useD3() {

const svg1 = d3.select('#container')

.append('svg')

.attr("width", 500)

.attr("height", 250)


const g = d3.select('svg')

.append('g')

.attr('transform', 'translate(50,50)')

.style('width','50px')


}

render () {

return (

<div id='container'>

</div>

)

}

}


export default Dthree


正在回答

1 回答

添加的那个属性无效你要说清楚啊 ?

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
使用D3制作图表
  • 参与学习       37886    人
  • 解答问题       112    个

教你使用最酷的数据可视化图表,初探数据可视化奥秘

进入课程

为g元素添加属性无效

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信