---
layout: example
title: Bar and Line Chart
permalink: /examples/bar-line-toggle/index.html
spec: bar-line-toggle
image: /examples/img/bar-line-toggle.png
---

An example of a Vega visualization that automatically switches between a bar chart and a line chart depending on the number of data points.

Use the slider to change the number of data points displayed on the chart. For more than 50 data points, the chart type will be changed from a bar chart to a line chart (with interpolation).

This Vega example made by Andrzej Leszkiewicz [@avatorl](https://github.com/avatorl).

{% include example spec=page.spec %}
