pub fn render_chart(
rows: &[Value],
opts: &ChartOptions,
) -> Result<ChartResult, McpError>Expand description
Render a chart from a list of JSON row objects.
rows is expected to be the output of execute_query_to_json: each entry
is a Value::Object with column name → value pairs. Non-object rows are
skipped silently.
§Errors
- Returns
ErrorCode::EmptyDataifrowsis empty. - Returns
ErrorCode::SchemaMismatchif required columns named inoptsare absent, if x or y columns cannot be interpreted as numeric for chart types that require numeric axes, or if a categorical axis produces zero distinct categories. - Returns
ErrorCode::InternalErrorwrapping failures from the underlyingplottersbackend during rendering or PNG/SVG encoding. - Returns
ErrorCode::InvalidArgumentif the result set exceeds 50,000 rows.