Member Junction
    Preparing search index...

    Action that generates SVG charts from data using D3. Supports bar, line, pie, scatter, and area charts.

    This action is designed for AI agents and workflows to create publication-quality visualizations from structured data without writing visualization code.

    // Simple bar chart
    await runAction({
    ActionName: 'Create SVG Chart',
    Params: [
    { Name: 'ChartType', Value: 'bar' },
    { Name: 'Data', Value: JSON.stringify([
    { label: 'A', value: 28 },
    { label: 'B', value: 55 },
    { label: 'C', value: 43 }
    ]) },
    { Name: 'Title', Value: 'Sample Bar Chart' }
    ]
    });

    // Line chart with X/Y data
    await runAction({
    ActionName: 'Create SVG Chart',
    Params: [
    { Name: 'ChartType', Value: 'line' },
    { Name: 'Data', Value: JSON.stringify([
    { x: 1, y: 10 },
    { x: 2, y: 25 },
    { x: 3, y: 15 }
    ]) }
    ]
    });

    // Pie chart
    await runAction({
    ActionName: 'Create SVG Chart',
    Params: [
    { Name: 'ChartType', Value: 'pie' },
    { Name: 'Data', Value: JSON.stringify([
    { label: 'LLM', value: 67 },
    { label: 'Embeddings', value: 10 }
    ]) }
    ]
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Generates an SVG chart from the provided data and configuration

      Parameters

      • params: RunActionParams

        The action parameters containing:

        • ChartType: Type of chart (bar, line, pie, scatter, area)
        • Data: JSON array of data objects
        • Title: Chart title (optional)
        • XAxisLabel: X-axis label (optional)
        • YAxisLabel: Y-axis label (optional)
        • Width: Chart width in pixels (optional, default: 800)
        • Height: Chart height in pixels (optional, default: 600)
        • Palette: Color palette name (optional, default: 'mjDefault')
        • ShowGrid: Show grid lines (optional, default: false)
        • ShowLegend: Show legend (optional, default: false)

      Returns Promise<SVGActionResult>

      A promise resolving to an ActionResultSimple with:

      • Success: true if chart was generated successfully
      • ResultCode: "SUCCESS" or error code
      • Message: The SVG string or error message