 c548ec9906
			
		
	
	c548ec9906
	
	
	
		
			
			* wip * wip * wip * wip * revert unnecessary changes * wip * refactor(frontend): enforce verbatimModuleSyntax * fix * refactor(frontend-shared): enforce verbatimModuleSyntax * wip * refactor(frontend-embed): enforce verbatimModuleSyntax * enforce consistent-type-imports * fix lint config * attemt to fix ci * fix lint * fix * fix * fix
		
			
				
	
	
		
			18 lines
		
	
	
		
			510 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			510 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /*
 | |
|  * SPDX-FileCopyrightText: syuilo and misskey-project
 | |
|  * SPDX-License-Identifier: AGPL-3.0-only
 | |
|  */
 | |
| 
 | |
| import type { Plugin } from 'chart.js';
 | |
| import MkChartLegend from '@/components/MkChartLegend.vue';
 | |
| 
 | |
| export const chartLegend = (legend: InstanceType<typeof MkChartLegend>) => ({
 | |
| 	id: 'htmlLegend',
 | |
| 	afterUpdate(chart, args, options) {
 | |
| 		// Reuse the built-in legendItems generator
 | |
| 		const items = chart.options.plugins.legend.labels.generateLabels(chart);
 | |
| 
 | |
| 		legend.update(chart, items);
 | |
| 	},
 | |
| }) as Plugin;
 |