Skip to content

Commit a59766c

Browse files
tomivirkkiclaude
andauthored
feat: add OHLC volume series guidance to chart AI tools (#9114)
## Summary - Adds LLM guidance for the OHLC/candlestick + volume series pattern to the `update_chart_data_source` tool description - Instructs the LLM to use `_x`, `_y`, and `_series` aliases for the volume query so the series gets proper datetime X values and a name for per-series config matching ### Testing - The fix can be tested using branch `fix/chart-ai-controller-candlestick-volume-test` Before: <img width="888" height="631" alt="candlestick-before" src="https://github.com/user-attachments/assets/7f22c7ad-efbe-45f0-aede-94bb24af46bf" /> After: <img width="889" height="632" alt="candlestick-after" src="https://github.com/user-attachments/assets/4d669be5-29df-41ab-b5ba-31748f2217ef" /> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9b2e44e commit a59766c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • vaadin-ai-components-flow-parent/vaadin-ai-components-flow/src/main/java/com/vaadin/flow/component/ai/chart

vaadin-ai-components-flow-parent/vaadin-ai-components-flow/src/main/java/com/vaadin/flow/component/ai/chart/ChartAITools.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,10 @@ Range charts (arearange, columnrange, areasplinerange):
574574
OHLC/Candlestick:
575575
- Columns: {X}, {OPEN}, {HIGH}, {LOW}, {CLOSE} ({X} is required for proper date axis)
576576
- Example: SELECT date AS {X}, open AS {OPEN}, high AS {HIGH}, low AS {LOW}, close AS {CLOSE} FROM stock_prices
577+
- When adding a volume series alongside OHLC/candlestick data, use a separate query \
578+
with {X}, {Y}, and {SERIES} aliases (e.g. SELECT date AS {X}, volume AS {Y}, 'Volume' AS {SERIES} \
579+
FROM stock_prices). The {SERIES} alias names the series so it can be configured via \
580+
update_chart_configuration() with type "column" and yAxis 1 on a dual y-axis setup.
577581
578582
Sankey diagram:
579583
- 3 columns: {FROM}, {TO}, {WEIGHT}

0 commit comments

Comments
 (0)