Whats New In AG Charts 12.3 - JavaScript Charting Library

What's New in AG Charts 12.3

AG Charts 12.3 adds axes crossing point, improved Sankey layout and options, difference area chart and range area styling, multi-style labels

Version 12.3 of AG Charts, our JavaScript Charting Library, adds enhanced layout control, improved styling capabilities along with many smaller feature enhancements and stability improvements.

The key features from this release include:

  1. Axis Crossing Point - Control where cartesian axes cross each other.
  2. Sankey Layout Options - Extra layout options and improved algorithm for Sankey series for cleaner appearance.
  3. Difference Area Chart - Additional invertedStyle and high and low differentiation extend the Range Area chart.
  4. Multi-Style Labels - Multiple font styles within series and axis labels.

Axis Crossing Point

Axes now have a crossAt property to control the specific value at which perpendicular axes intersect.

This provides greater control over the chart's origin, which is useful for creating charts with negative values or for analyses where data needs to be compared against a specific baseline other than zero.

const options = {
    // ... other options
    axes: [
            {
                type: 'number',
                position: 'left',
                // place the left axis at '0' on the bottom axis scale
                crossAt: { value: 0 },
            },
            {
                type: 'number',
                position: 'bottom',
                // place the bottom axis at '0' on the left axis scale
                crossAt: { value: 0 },
            },
        ],
};
Line chart titled 'Axes crossing at 0': a hyperbola with red x and y axes crossing at the origin, not the chart edge

Sankey Layout Options

This release introduces an improved default layout for Sankey diagrams that optimizes space usage, reduces overlaps and adapts better to smaller chart sizes.

New layout options provide greater control over node positioning and label placement, enhancing clarity and readability. The new sort option allows sorting by data order or alphabetically, while the auto sort option automatically improves layout efficiency and reduces overlapping links.

const options = {
    // ... other options
    series: [
        {
            type: 'sankey',
            // ... data keys
            node: {
                alignment: 'justify',
                verticalAlignment: 'top',
                sort: 'auto',
                node: {minSpacing: 10},
            },
        },
    ],
};
Sankey chart of 2023 Nike revenue flowing from products and regions through revenues to profit, costs and net income

Difference Area Chart

New style options on the range-area series allow creating a Difference Area Chart as well as greater customisation of low and high values.

Negative ranges can be styled using the invertedStyle option. The high and low styling options improve clarity when lines frequently cross.

Difference area chart of fossil fuel vs renewable electricity, 2019 to 2025, shaded red where fossil fuels dominate

Multi-Style Labels

Label formatters now support multi-style text. By returning an array of text objects from a formatter, you can apply different font sizes, weights, and colors to different parts of a single label.

This allows for the creation of more informative and visually rich labels that can emphasize key values or add secondary information.

const options = {
    // ... other options
    series: [
        {
            type: 'pie',
            // ... data keys
            calloutLabel: {
                formatter: ({ datum }) => {
                    return [
                        {
                            text: datum.value.toString(),
                            fontSize: 20,
                            fontWeight: 'bold',
                        },
                        {
                            text: datum.label,
                            fontSize: 12,
                            color: 'gray',
                        },
                    ];
                },
            },
        },
    ],
};
Pie chart of Q4 2024 technology revenue by segment; each label has a large dollar value over a small name, e.g. Cloud $42,500

Summary

AG Charts 12.3 continues to enhance developer and end-user experience through deeper and broader styling and layout controls along with many smaller feature enhancements and stability improvements.

💡
See the Release Notes for details or the Changelog for a full list of changes.

As always, we're here to help you upgrade, and we're keen to hear your feedback. Enterprise customers can contact us via Zendesk; Alternatively, please submit a GitHub issue.

Next Steps

New to AG Charts? Get started in minutes, for free:

Happy coding!

  • David Glickman
    Written by David Glickman Technical Product Manager

    Technical Product Manager at AG Grid, responsible for AG Charts