目前,我在使用 Google 图表创建的时间轴中有交替的背景颜色。这是图表组件:
return (
<div class="row" style={{ marginBottom: 30, zoom: "75%" }}>
<Chart
width={'100%'}
height={'200px'}
chartType="Timeline"
loader={<div>Loading Chart</div>}
columns={
[
{ type: 'string', id: 'Position' },
{ type: 'string', id: 'Name' },
{ type: 'date', id: 'Start' },
{ type: 'date', id: 'End' },
]
}
rows={
timelineData.map((data, idx) => (
[
data.type,
data.name,
new Date(data.ysD, data.msD, data.dsD),
new Date(data.yeD, data.meD, data.deD)
]
))
}
options={{
timeline: {
colorByRowLabel: true,
},
backgroundColor: {
fill: 'white'
}
}}
rootProps={{ 'data-testid': '3' }}
/>
</div>
)
这是它的样子:
我想删除那种交替的灰色,只想为每一行保留白色。有没有办法在 React 中做到这一点?