Cartesian Charts: Part 3

Mixed Charts

You can mix charts by using mixed_charts or combo_charts methods. For example, given that:

@total_properties = Property.group_by_week(:created_at).count

and

<% total_series = {
  name: "Total", data: @total_properties
} %>

you can do this:

<%= combo_charts({**options, theme: 'palette4', stacked: false, data_labels: false}) do %>
  <% line_chart(total_series) %>
  <% area_chart(series.last) %>
  <% column_chart(series.first) %>
<% end %>
Example Mixed Charts

Syncing Charts

You can synchronize charts by using syncing_charts or synchronized_charts methods. For example:

Example Syncing Charts

Brush Chart

Example Brush Chart

Annotations

All cartesian charts can have annotations, for example:

Example Area Chart with Annotations

Multiple Y-Axes

There's no fancy shortcut for multiple Y axes yet, but it is allowed. Here is an example for that.

Example Chart with multiple Y-Axes

Last updated