Appearance
Visual QA for AI
You cannot judge ChartBuddy charts from chartData alone.
Loop
- Generate HTML with
new Insight(..., { instanceId, chartData }) - Open in a real browser
- Wait for
ready(orinsight.on('ready', …)) - Observe via return values (preferred):
js
const insight = window.__CHARTBUDDY_INSIGHTS__['revenue'];
const cd = insight.getChartData();
// Default underlay is #ffffff; pass any CSS color for dark decks, etc.
const png = await insight.toPngBase64({ background: '#ffffff' });- Fix config (orientation, subtitle, ticks, container height) with a partial update:
js
insight.setData([['', 'Q1'], ['Revenue', 120]]);
insight.update({ subtitle: { visible: false, text: '' } });- Write PNG / JSON into the workspace yourself — do not rely on
downloadPng()Save dialogs
chartData.backgroundColor does not bake into PNGs. Use the background export option.
Unknown chartType values throw at the API boundary — treat that as a signal to self-correct, not as a blank chart to debug.
Probe
js
insight.chart.cd.chartType
insight.chart.cd.orientation
insight.chart.cd.axes
insight.getChartData()
insight.isDirty()For horizontal bars, confirm domain is on the left and primary range on the bottom.
Fixture hygiene
- Unique stable
instanceIdper mount (duplicates throw) persist: false- Reset stale localStorage if a page still looks wrong