瀏覽代碼

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;

Loading…
取消
儲存