显示渲染图形的屏幕截图:

<Chart
width={'100%'}
height={'600px'}
chartType="LineChart"
loader={<div>Loading Chart</div>}
data={[
['Date', 'Value'],
[new Date(1996, 1, 1), 2000 * Math.random()],
[new Date(1997, 1, 1), 2000 * Math.random()],
[new Date(1998, 1, 1), 2000 * Math.random()],
[new Date(1999, 1, 1), 2000 * Math.random()],
[new Date(2000, 1, 1), 2000 * Math.random()],
[new Date(2001, 1, 1), 2000 * Math.random()],
[new Date(2002, 1, 1), 2000 * Math.random()],
[new Date(2003, 1, 1), 2000 * Math.random()],
[new Date(2004, 1, 1), 2000 * Math.random()],
[new Date(2005, 1, 1), 2000 * Math.random()],
[new Date(2006, 1, 1), 2000 * Math.random()],
[new Date(2007, 1, 1), 2000 * Math.random()],
[new Date(2008, 1, 1), 2000 * Math.random()],
[new Date(2009, 1, 1), 2000 * Math.random()],
]}
options={{
// Use the same chart area width as the control for axis alignment.
chartArea: { height: '80%', width: '90%' },
hAxis: { slantedText: false },
vAxis: { viewWindow: { min: 0, max: 2000 } },
legend: { position: 'none' },
}}
chartPackages={['corechart', 'controls']}
controls={[
{
controlType: 'ChartRangeFilter',
options: {
filterColumnIndex: 0,
ui: {
chartType: 'LineChart',
chartOptions: {
chartArea: { width: '90%', height: '50%' },
hAxis: { baselineColor: 'none' },
},
},
},
controlPosition: 'bottom',
controlWrapperParams: {
state: {
range: { start: new Date(1996, 1, 9), end: new Date(2010, 2, 20) },
},
},
},
]}
/>
我可以渲染图形,但看不到日期范围滑块来控制日期范围,有人可以帮助解决这个问题吗?我尝试在x轴上显示时间范围,在y轴上显示一些数字数据。我只是从react-google-charts中复制了代码,并没有做太多修改,我还需要在代码中包含什么吗?
发布于 2018-11-13 23:05:42
我试图重现这个问题,但正如你所看到的here,它工作正常。
您遇到的问题有两种可能的原因:
希望这能有所帮助,
干杯!
https://stackoverflow.com/questions/53160843
复制相似问题