1

在此处输入图像描述

在明星的地方,我想显示一些自定义图像,如面部表情符号。我在这里使用 react-google-chart 库 。到目前为止,我的代码如下

           import { Chart } from "react-google-charts";
           ...

           <Chart
              width={'500px'}
              height={'300px'}
              chartType="AreaChart"
              loader={<div>Loading Chart</div>}
              data={[
                ['Year',  'Expenses', {'type': 'string', 'role': 'style'}],
                ['2013',  400, null],
                ['2014',  460, null],
                ['2015',  1120, 'point { size: 18; shape-type: star; fill-color: #a52714; }'],
                ['2016',  540, null],
              ]}
              options={{
                title: 'Company Performance',
                hAxis: { title: 'Year', titleTextStyle: { color: '#333' } },
                vAxis: { minValue: 0 },
                // For the legend to fit, we make the chart area smaller
                chartArea: { width: '50%', height: '70%' },
                // lineWidth: 25
                pointSize: 20,
                // series: {
                //   0: { pointShape: { type: 'star', sides: 5, dent: 0.5 } }
                // }
              }}
              // For tests
              rootProps={{ 'data-testid': '1' }}
            />
4

0 回答 0