浏览代码

fe-34 ej2-react-charts SparkLine

master
Chunxian Zhang 2 年前
父节点
当前提交
f0cd5bc231
共有 1 个文件被更改,包括 37 次插入0 次删除
  1. +37
    -0
      lazy-timer-fe/src/components/Charts/SparkLine.jsx

+ 37
- 0
lazy-timer-fe/src/components/Charts/SparkLine.jsx 查看文件

@ -0,0 +1,37 @@
import React from 'react';
import { SparklineComponent, Inject, SparklineTooltip } from '@syncfusion/ej2-react-charts';
class SparkLine extends React.PureComponent {
render() {
const { id, height, width, color, data, type, currentColor } = this.props;
return (
<SparklineComponent
id={id}
height={height}
width={width}
lineWidth={1}
valueType="Numeric"
fill={color}
border={{ color: currentColor, width: 2 }}
tooltipSettings={{
visible: true,
// eslint-disable-next-line no-template-curly-in-string
format: '${x} : data ${yval}',
trackLineSettings: {
visible: true,
},
}}
markerSettings={{ visible: ['All'], size: 2.5, fill: currentColor }}
dataSource={data}
xName="x"
yName="yval"
type={type}
>
<Inject services={[SparklineTooltip]} />
</SparklineComponent>
);
}
}
export default SparkLine;

正在加载...
取消
保存