Hexastack / eazychart

EazyChart is a reactive chart library 📈, it allows you to easily add SVG charts in your React and Vue web applications.
https://eazychart.com
MIT License
23 stars 14 forks source link

feat: add scale providers #32

Closed marrouchi closed 2 years ago

marrouchi commented 2 years ago

Motivation

The current implementation does not allow to have multiple domain keys per scale. We have a domain key for each scale. This does not allow to have multi-line chart or equivalent charts without having to grow the dataset (with a normalized data structure) and doing a "group by" operation.

I think we need to :

  1. Define scales as context providers
  2. Treat the colors as a scale
  3. Let the chart recipe define it's own way to toggle data via the legend.
  4. Dissociate the domain key used in the shapes from the one defined in the scale definition.

The current PR includes the following :

As a proof of concept, this PR includes a multi-line chart :

image

Other changes

There's also some unrelated minor changes :

Type of change

Please delete options that are not relevant.

Checklist: