import React, { useEffect } from 'react';
import { AreaSpline, LineBar, MinArea, doubleY } from './index';
import RenderChart from '../RenderChart';
import Highcharts from 'highcharts';
window.Highcharts = Highcharts;
const Demo: React.FC<{}> = () => {
const op = AreaSpline({
series:[
{
name: '小张',
data: [3, 4, 3, 5, 4, 10, 12],
after: 'mm',
th: '自定义的标题',
},
{
name: '小潘',
data: [1, 3, 4, 3, 3, 5, 4]
}
],
yPlotLines:[{
value: 9,
text: '平均值',
}],
yTitle: {text: '入口名称', x: 25, y: 10},
yLabelsFormat: '{value}%',
categories: [ '周一','周二','周三','周四','周五','周六','周日' ]
});
return ;
};
const Demo11: React.FC<{}> = () => {
const op = AreaSpline({
series:[
{
name: '小张',
data: [3, 4, 3, 5, 4, 10, 12],
after: 'mm',
th: '自定义的标题',
tipFormatter: '
入口曝光uv: 5,655
入口曝光uv: 5,655
'
},
{
name: '小潘',
data: [1, 3, 4, 3, 3, 5, 6],
tipFormatter: '入口曝光uv: 5,655
入口曝光uv: 5,655
'
}
],
tipFmt: 'formatter2',
yPlotLines:[{
value: 9,
text: '平均值',
x: -100,
y: -150
}],
yTitle: '入口名称',
yLabelsFormat: '{value}%',
categories: [ '周一','周二','周三','周四','周五','周六','周日' ]
});
return ;
};
const Demo2: React.FC<{}> = () => {
const op = LineBar({
lineSeries:[
{
name: '小张',
data: [3, 4, 3, 5, 4, 10, 12]
},
{
name: '小潘',
data: [1, 3, 4, 3, 3, 5, 4]
}
],
tipFmt: 'formatter2',
lineYPlotLines:[{
value: 9,
text: '平均值',
}],
barYPlotLines:[{
value: 66,
color: 'red',
text: '平均值2',
}],
barSeries: [{
name: '小明',
tipFormatter: '入口曝光uv: 5,655
入口曝光uv: 5,655
',
data: [53, 45, 63, 75, 48, 86, 52],
after: 'css'
}],
yTitle: ['入口名称', '入口名称2'],
yLabelsFormat: ['{value}cc', '{value}dd'],
categories: [ '周一','周二','周三','周四','周五','周六','周日' ]
});
return ;
};
const Demo3: React.FC<{}> = () => {
const op = MinArea({
series:[
{
data: [3, 4, 3, 5, 4, 10, 12],
name: '小明'
}
],
categories: [ '周一','周二','周三','周四','周五','周六','周日' ]
});
return
;
};
const Demo4: React.FC<{}> = () => {
const op = doubleY({
leftYData:[
{
name: '小张',
data: [3, 4, 3, 5, 4, 10, 12],
type: 'areaspline',
th: '大家诶我',
},
{
name: '小潘',
data: [1, 3, 4, 3, 3, 5, 4],
type: 'areaspline'
}
],
rightYData: [
{
name: '小明',
data: [53, 45, 63, 75, 48, 86, 52],
after: 'css',
type: 'column'
},
{
name: '平均值',
data: [50, 50, 50, 50, 50, 50, 50],
type: 'line',
dashStyle: 'ShortDash'
}
],
leftYPlotLines:[{
value: 9,
text: '平均值',
}],
rightYPlotLines:[{
value: 66,
color: 'red',
text: '平均值2',
}],
yTitle: [{text: '入口名称', x: 25}, '入口名称2'],
yLabelsFormat: ['{value}cc', '{value}dd'],
categories: [ '周一','周二','周三','周四','周五','周六','周日' ]
});
return ;
};
const Demo5: React.FC<{}> = () => {
const op = AreaSpline({
series:[
{
name: '小张',
data: [3, 4, 3, 5, 4, 10, 12],
tipHead(e: any) {
return `标题 | X轴${e.x} | `;
},
tipBody(e: any) {
return e.points.map((val: any) => (
`
| ${val.series.name} |
${val.y} |
`
)).join('')
}
},
{
name: '小潘',
data: [1, 3, 4, 3, 3, 5, 4]
}
],
categories: [ '周一','周二','周三','周四','周五','周六','周日' ]
});
return ;
};
export { Demo, Demo11, Demo2, Demo3, Demo4, Demo5 };