|
@@ -28,8 +28,8 @@ function Usertrend(prop) {
|
|
|
height: height - 20,
|
|
|
width,
|
|
|
padding: [
|
|
|
- 10,
|
|
|
- 40,
|
|
|
+ 20,
|
|
|
+ 60,
|
|
|
30,
|
|
|
70,
|
|
|
]
|
|
@@ -47,7 +47,8 @@ function Usertrend(prop) {
|
|
|
chart.scale('Data', {
|
|
|
range: [0, 1],
|
|
|
tickCount: 10,
|
|
|
- type: 'timeCat'
|
|
|
+ type: 'timeCat',
|
|
|
+ mask: "MM-DD"
|
|
|
});
|
|
|
chart.scale('sales', {
|
|
|
nice: true,
|
|
@@ -69,7 +70,7 @@ function Usertrend(prop) {
|
|
|
chart.axis('sales', {
|
|
|
label: {
|
|
|
formatter: n => {
|
|
|
- return utils.formatNumber(n,2);
|
|
|
+ return utils.formatNumber(n, 2);
|
|
|
},
|
|
|
style: {
|
|
|
fill: "#fff"
|
|
@@ -87,8 +88,22 @@ function Usertrend(prop) {
|
|
|
});
|
|
|
chart.tooltip(false);
|
|
|
|
|
|
- chart.line().shape('smooth').color('#3ae8ef').position('Data*sales');
|
|
|
+ chart.line().shape('smooth').color('#3ae8ef').position('Data*sales').label('sales', val => {
|
|
|
+ return {
|
|
|
+ content: utils.formatNumber(val, 2),
|
|
|
+ offsetX: 20,
|
|
|
+ style: {
|
|
|
+ fill: "#ffffff",
|
|
|
+ },
|
|
|
+ transform: [
|
|
|
+ {
|
|
|
+ type: 'overlapHide',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ });
|
|
|
chart.area().shape('smooth').color('l(90) 0:#3ae8ef 1:rgba(0,0,0,0)').position('Data*sales');
|
|
|
+ chart.point().shape('smooth').position('Data*sales')
|
|
|
chart.render();
|
|
|
}
|
|
|
onMount(() => {
|