Gap Chart
Comparison
How far apart are the two numbers that matter? Plot before and after, target and actual, men and women, and the bar between them is the story - the wider the gap, the louder it reads.
canvas · responsive
The chart above is the same engine in every framework - only the integration code below differs.
Usage
tsx
import { GapChart } from "@michi-vz/react";
export default () => <GapChart {...props} />; // props = the chart optionsvue
<script setup>
import { GapChart } from "@michi-vz/vue";
</script>
<template>
<GapChart :options="props" />
</template>svelte
<script>
import { gapChart } from "@michi-vz/svelte";
</script>
<div use:gapChart={props}></div>ts
// main.ts - register the elements once
import "@michi-vz/angular";
import { applyGapChartProps } from "@michi-vz/angular";
// component (uses CUSTOM_ELEMENTS_SCHEMA)
// template: <michi-vz-gap-chart #c></michi-vz-gap-chart>
applyGapChartProps(this.c.nativeElement, props);html
<script type="module" src="https://cdn.jsdelivr.net/npm/@michi-vz/wc"></script>
<michi-vz-gap-chart id="c"></michi-vz-gap-chart>
<script>
Object.assign(document.getElementById("c"), props); // dataSet/series, title, …
</script>ts
import { mountGapChart } from "@michi-vz/core";
const chart = mountGapChart(el, props);
chart.update(next);
chart.getContext(); // renderer-agnostic, LLM-ready
chart.destroy();API
Props are typed as GapChartProps in @michi-vz/core. Shared across all charts: width, height, margin, colors / colorsMapping, renderer ("svg" | "canvas"), highlightItems, disabledItems, and the on* callbacks. onChartDataProcessed / getContext() return the renderer-agnostic ChartContext.