Data
You can add data to a chart in many different ways. You could provide data like this:
Config
When calling c2mChart, there are several different config items that you can provide:
CC styling
The cc option lets you provide the "closed caption" element that Chart2Music updates as users explore a chart. Screen readers use this element to announce Chart2Music's generated text, and developers can style it to fit the page.
Element
The source or target element can technically be any visible HTML or SVG element. That said, the most common elements are CANVAS, SVG, DIV, and IMG.
Hierarchies
Chart2Music supports hierarchical data for chart types such as treemaps. A hierarchical chart is still passed as grouped data, but each point can name a child group with the children property. The starting group is set with options.root.
Developer integration
Using c2mChart to sonify a static chart is already powerful, but you can also sonify dynamic charts.
Methods
When you invoke Chart2Music, it will return 2 items:
React
If you're using Recharts, one of the most popular React charting libraries, we already have a CodePen example that integrates Recharts and Chart2Music: