Accessible Charts Done Right

Sergei Kriger

Accessible Charts Done Right

SinnerSchrader logo
sergeikriger.com @_sergeikriger
Hiring

7 632 819 325

www.worldometers.info

Top 10

MexicoRussiaBangladeshNigeriaPakistanBrazilIndonesiaUnited StatesIndiaChina129 163 276143 989 754164 669 751190 886 311197 015 955209 288 278263 991 379324 459 4631 339 180 1271 409 517 397
www.worldometers.info

By region

AsiaAfricaEuropeLatin AmericaNorthern AmericaOceania(4 545 133 094)(1 287 920 518)(742 648 010)(652 012 001)(363 844 490)(41 261 212)AsiaAfricaEuropeLatin AmericaNorthern AmericaOceania
217M
www.iapb.org    www.colourblindawareness.org    www.iapb.org

#1
It's possible

plan

A chart with the information about how many apples were sold.30 Jun01 Jul02 Jul03 Jul04 Jul012345apples sold, kgapples sold, kg

Chart description

A chart with the information about how many apples were sold.30 Jun01 Jul02 Jul03 Jul04 Jul012345apples sold, kgapples sold, kg

A chart with the information about how many apples were sold.

Minimum apples sold: 2 kilograms.30 Jun01 Jul02 Jul03 Jul04 Jul012345apples sold, kgmin valueapples sold, kgmin value

Minimum apples 2 kg was sold on July 03.

The goal to sell 4 kilograms was achieved on July 1, July 4.30 Jun01 Jul02 Jul03 Jul04 Jul012345apples sold, kgapples sold, kgtarget value

The goal to sell 4 kg was achieved on July 03 and July 05.

#2
Know what you show

			const tmpl = "Minimum apples {{WEIGHT}} kg was sold on {{DATE}}."
			 
			<svg role="img" alt="Minimum apples 2 kg was sold on July 03.">
				...
			</svg>
		
			const tmpl = "Minimum apples {{WEIGHT}} kg was sold on {{DATE}}."
			 
			<svg role="img" aria-label="Sales statistics" aria-describedby="chart-desc">
				<desc id="chart-desc">Minimum apples 2 kg was sold on July 03.</desc>
				...
			</svg>
		

Tips

3 kg of apples, 3 kg of bananas, 1 kg of oranges was sold on July 01 with total transaction value of 19 €. 4 kg of apples, 3 kg of bananas, 5 kg of oranges was sold on July 02 with total transaction value of 38 €. 2 kg of apples, 2 kg of bananas, 4 kg of oranges was sold on July 03 with total transaction value of 26 €. 3 kg of apples, 1 kg of bananas, 5 kg of oranges was sold on July 04 with total transaction value of 31 €. 5 kg of apples, 2 kg of bananas, 1 kg of oranges was sold on July 05 with total transaction value of 23 €.

Readable chart bars

			<svg class="chart">
				<rect tabindex="0" aria-label="Apples, 3 kg sold on July 1"></rect>
				<rect tabindex="0" aria-label="Apples, 4 kg sold on July 2"></rect>
				<rect tabindex="0" aria-label="Apples, 3 kg sold on July 3"></rect>
			</svg>
		
			<svg>
				<g class="x axis" aria-hidden="true"></g>
				<g class="y axis" aria-hidden="true"></g>
			    ...
				<rect tabindex="0" aria-label="Apples, 3 kg sold on July 1"></rect>
				<rect tabindex="0" aria-label="Apples, 4 kg sold on July 2"></rect>
				<rect tabindex="0" aria-label="Apples, 3 kg sold on July 3"></rect>
			</svg>
		

Tips

#3
Accessible data

Charts and tables

			<body>
				<svg aria-hidden="true"></svg>
				<table class="visually-hidden"></table>
			</body>
		
			.visually-hidden {
			    position: absolute !important;
			    height: 1px;
			    width: 1px;
			    overflow: hidden;
			    clip: rect(1px, 1px, 1px, 1px);
			}
		
snook.ca
			<body>
				<div class="tabs">
					<div class="tab">
						<svg></svg>
					</div>
					<div class="tab">
						<table></table>
					</div>
				</div>
			</body>
		
Screenshot from ec.europa.eu
Screenshot from ec.europa.eu
Screenshot from ec.europa.eu
			<table>
			    <caption>Bob's data</caption>
				<tr>
				    <th scope="col">Date</th>
				</tr>
				<tr>
				    <th scope="row">Jul 01</th>
				</tr>
			</table>
		
inclusive-components.design/data-tables/
Bob's data'
DateAppleBananaOrange
Jun 30331
Jul 01435
Jul 02224
Jul 03315
Jul 04521
Anna's data'
DateAppleBananaOrange
Jun 30312
Jul 01154
Jul 02344
Jul 03251
Jul 04523
Bob's data
Date Apple Banana Orange
Jul 01 3 3 1
Jul 02 4 3 5
Jul 03 2 2 4
Jul 04 3 1 5
Jul 05 5 2 1
Anna's data
Date Apple Banana Orange
Jul 01 3 1 2
Jul 02 1 5 4
Jul 03 3 4 4
Jul 04 2 5 1
Jul 05 5 2 3
Total transactions data
Date Value
Jul 01 38
Jul 02 67
Jul 03 59
Jul 04 51
Jul 05 54
Screenshot from webaim.org

Tips

What else?

Screenshot from worldbank.org

16s 93

248

Server-side rendering

Tips

Recap

Recap

Screen reader

a11y

Charts

Thanks!..

@_sergeikriger
sergeikriger.com
bit.ly/a11y-charts Presentation QR code.

Credits

Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY
Icons made by Anton Saputro from www.flaticon.com is licensed by CC 3.0 BY
Icons made by Llisole from www.thenounproject.com is licensed by CC 3.0 BY
Icons made by Smashicons from www.flaticon.com is licensed by CC 3.0 BY
Icons made by Pixel perfect from www.flaticon.com is licensed by CC 3.0 BY