GSS-Cogs / chart-builder

The Chart Builder is a proof-of-concept app to understand the feasibility of using a CSV file (or SPARQL query) to generate and customise a chart or data visualisation
https://chart-builder-no4vxskx7a-nw.a.run.app
2 stars 0 forks source link

Allow the user to assign colours and styles (e.g. dashed line) to series #55

Closed charlesons closed 2 years ago

charlesons commented 2 years ago

For chart types where data is represented as distinct series the user may wish to specify colour and other stylistic properties of the series.

This issue covers series styling for line and bar charts.

The existing code allows the user to specify a subset of data series to display from the available series on the selected dimension. The user can also set a currently series label.

Some considerations for the implementation:

Some related issues are:

72 Allow the user to specify the data series order

51 Visual axis data and label assignment

Definition of Done

Acceptance criteria

ajtucker commented 2 years ago

Allow user to override default colour / style for a given series.

charlesons commented 2 years ago

Reviewed and refactored DataSelection and DimensionSelection components which deal respectively with assigning data columns to axes and defining the series to display.

Within DimensionSelection we currently set the series label. We need to expand this to allow the user to assign multiple properties to the series.

Proposed implementation consists of:

UX considerations The proposed series styling features form an additional step in the user's process of defining the data to display on the chart. As such this may be a good opportunity to break the data definition process into a stepwise process.

charlesons commented 2 years ago

To create a selectable list of colours for the user to specify series colours we initially looked at the HTML Select component but this has limitations on the extent of styling that can be applied to the list options.

https://stackoverflow.com/questions/62779788/set-background-color-of-option-in-select

https://stackoverflow.com/questions/46596240/svg-inside-option-element

We conclude that a custom select component would better meet our need to present richly styled options to the user (e.g. colours, lines, shading, etc).