// In an app: import { setupChartjs } from '@aparte/plugin-chartjs'; setupChartjs();
// A chartjs fence holds the library's own { type, data, options }.
const config = {
type: 'line',
data: {
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
datasets: [
{ label: 'This week', data: [820, 932, 901, 934, 1290, 1330, 1320], fill: true, tension: 0.35 },
{ label: 'Last week', data: [760, 810, 870, 880, 1010, 1150, 1090], tension: 0.35 },
],
},
options: { plugins: { title: { display: true, text: 'Visitors per day' } } },
};
document.querySelector('aparte-chat-bubble').setSegments([
{ id: 's1', type: 'code', language: 'chartjs', content: JSON.stringify(config, null, 2) },
]);