Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 如何在ReCharts中缩小面积图_Reactjs_D3.js_Charts_Jsx_Recharts - Fatal编程技术网

Reactjs 如何在ReCharts中缩小面积图

Reactjs 如何在ReCharts中缩小面积图,reactjs,d3.js,charts,jsx,recharts,Reactjs,D3.js,Charts,Jsx,Recharts,我使用的是recharts库,我的数据值非常大,因为我使用的是感染了新冠病毒的数字,但我的图表太大了,我只想在给定区域显示它 所以问题是在我的数据中,Recharts接受数字而不是字符串,但我给它字符串 <Box w="5xl" py={4} px={8} rounded="lg" bg={useColorModeValue("white", "gray.900")} shado

我使用的是recharts库,我的数据值非常大,因为我使用的是感染了新冠病毒的数字,但我的图表太大了,我只想在给定区域显示它


所以问题是在我的数据中,Recharts接受数字而不是字符串,但我给它字符串

   <Box
  w="5xl"
  py={4}
  px={8}
  rounded="lg"
  bg={useColorModeValue("white", "gray.900")}
  shadow="lg"
>
  <Flex justify="center">
    <Select mb="1.5" width="47%" variant="filled" onChange={addOpt}>
      <option defaultValue>Choose an option</option>
      <option>Infected</option>
      <option>Recovered</option>
      <option>Deceased</option>
    </Select>
  </Flex>
  <div>
    <ResponsiveContainer width="100%" height={500}>
      <AreaChart data={chartdata.length > 1 ? chartdata : data}>
        <Area dataKey="ykey"/>
        <XAxis dataKey="data"/>
        <YAxis dataKey="ykey"/>
      </AreaChart>
    </ResponsiveContainer>
  </div>
</Box>
[   "0",   {
    "ykey": "1766"   },   {
    "ykey": "1804"   },   {
    "ykey": "1854"   },   {
    "ykey": "1894"   },   {
    "ykey": "1932"   },   {
    "ykey": "1984"   },   {
    "ykey": "2060"   },   {
    "ykey": "2127"   },   {
    "ykey": "2204"   },   {
    "ykey": "2279"   },   {
    "ykey": "2422"   },   {
    "ykey": "2519"   },   {
    "ykey": "2589"   },   {
    "ykey": "2693"   },   {
    "ykey": "2758"   },   {
    "ykey": "2879"   },   {
    "ykey": "2980"   },   {
    "ykey": "3138"   },   {
    "ykey": "3254"   },   {
    "ykey": "3274"   },   {
    "ykey": "3387"   },   {
    "ykey": "3518"   },   {
    "ykey": "3631"   },   {
    "ykey": "3749"   }]