folkehelseinstituttet / Fhi.Frontend.Demo

MIT License
2 stars 1 forks source link

Add support for more diagram metadata #533

Closed proand closed 2 months ago

proand commented 3 months ago

Description

Based on changes to the API deicided in https://github.com/folkehelseinstituttet/Fhi.Frontend.RnD/issues/11, and data from MEASURE_TYPE (see const unit below):

Acceptance Criteria

Given:

  1. FhiDiagramOptions updated to handle JSON-stat MEASURE_TYPE
  2. Design for y-axes labels landed
  3. Demo example for showing decimals available

Then:

  1. Go to https://dev-designsystem.fhi.no/developer/components/highcharts#highcharts-all-inclusive
  2. Check that y-axes label looks like in Figma
  3. Select "Andel i prosent"
  4. Check that y-axes %-symbol looks ok
  5. Hover over a column
  6. Check that tooltip also looks as expected
  7. Select Table
  8. Check that all numbers has 1 decimal
  9. ...and check that API documentation is updated

Supplementary information

New property on the interface FhiDiagramOptions:

unit?: FhiDiagramUnit;

Data to use in demo-app example:

const unit: [
  {
    decimals: 1,
    label: "Prosent",
    symbol: "%",
    position: "end",
  },
  {
    label: "Antall",
  },
];