more beautiful chart
Gitea Actions Demo / build_and_push (push) Has been cancelled
Details
Gitea Actions Demo / build_and_push (push) Has been cancelled
Details
This commit is contained in:
parent
f001054b72
commit
fe4b037d0c
|
|
@ -11,8 +11,8 @@ import axios from 'axios';
|
||||||
import { AxiosResponse } from "axios";
|
import { AxiosResponse } from "axios";
|
||||||
import { createYmaps } from 'vue-yandex-maps';
|
import { createYmaps } from 'vue-yandex-maps';
|
||||||
|
|
||||||
const HOST = "https://cycle-rider.ru";
|
// const HOST = "https://cycle-rider.ru";
|
||||||
// const HOST = "http://localhost:8000";
|
const HOST = "http://localhost:8000";
|
||||||
|
|
||||||
axios.defaults.baseURL = HOST;
|
axios.defaults.baseURL = HOST;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</yandex-map>
|
</yandex-map>
|
||||||
<LineWithLineChart id="my-chart-id" :options="chartOptions" :data="data" />
|
<!-- @vue-ignore -->
|
||||||
|
<LineWithLineChart id="my-chart-id" :options="chartOptions" :data="data" />
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
|
@ -131,17 +132,40 @@ const chartOptions ={
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
zoom: {
|
tooltip: {
|
||||||
|
enabled: true,
|
||||||
|
intersect: false,
|
||||||
|
footerMarginTop: 10,
|
||||||
|
displayColors: false,
|
||||||
|
callbacks: {
|
||||||
|
label: function(context: any) {
|
||||||
|
let label = context.dataset.label || '';
|
||||||
|
|
||||||
|
if (label) {
|
||||||
|
label += ': ';
|
||||||
|
}
|
||||||
|
if (context.parsed.x !== null) {
|
||||||
|
console.log(typeof context)
|
||||||
|
label += new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(context.parsed.y);
|
||||||
|
}
|
||||||
|
return ["Скорость: " + data.value.datasets[0].data[context.dataIndex],
|
||||||
|
"Пульс: " + data.value.datasets[1].data[context.dataIndex],
|
||||||
|
"Мощность: " + data.value.datasets[2].data[context.dataIndex],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
zoom: {
|
zoom: {
|
||||||
drag: {
|
zoom: {
|
||||||
enabled: true,
|
drag: {
|
||||||
},
|
enabled: true,
|
||||||
pinch: {
|
},
|
||||||
enabled: true
|
pinch: {
|
||||||
},
|
enabled: true
|
||||||
mode: 'x',
|
},
|
||||||
|
mode: 'x',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const msToKmh = (ms: number) => ms * 3.6;
|
const msToKmh = (ms: number) => ms * 3.6;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue