提交 d083af8c 编写于 作者: D DebugIsFalse

Merge branch 'main' of gitcode.com:git_bot/ai-fe

<template> <template>
<div class="w-full"> <div class="w-full relative" style="aspect-ratio: 2/1">
<canvas id="chart"></canvas> <canvas id="chart" :aria-label="title"></canvas>
</div> </div>
</template> </template>
<script setup> <script setup>
import { Chart } from 'chart.js/auto'; import { Chart } from 'chart.js/auto';
const props = defineProps({ const props = defineProps({
type: {
type: String,
default: 'line'
},
title: { title: {
type: String, type: String,
default: '' default: ''
...@@ -21,7 +25,7 @@ const props = defineProps({ ...@@ -21,7 +25,7 @@ const props = defineProps({
}) })
onMounted(() => { onMounted(() => {
new Chart(document.getElementById('chart'), { new Chart(document.getElementById('chart'), {
type: 'line', type: props.type,
data: { data: {
labels: props.labels, labels: props.labels,
datasets: [ datasets: [
......
<template> <template>
<IMdMdc :content="mdStr"/> <div class="w-full p-6">
<IMdMdc :content="mdStr"/>
</div>
</template> </template>
<script setup> <script setup>
const mdStr = ` const mdStr = `
::ProseLineChart{title='langchain-ai/langchain [2023-06-05,2024-06-04] Star Data' :labels='["2023-06-05","2023-06-12"]' :data='[43071,44946]'} ::ProseChart{title='langchain-ai/langchain [2023-06-05,2024-06-04] Star Data' :labels='["2023-06-05","2023-06-12"]' :data='[43071,44946]'}
` `
</script> </script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册