New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@folkehelseinstituttet/angular-highcharts

Package Overview
Dependencies
Maintainers
0
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@folkehelseinstituttet/angular-highcharts

_An opinionated wrapper to the official minimal [Highcharts wrapper for Angular](https://github.com/highcharts/highcharts-angular)_

  • 5.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
70
increased by1.45%
Maintainers
0
Weekly downloads
 
Created
Source

FHI Angular Highcharts

An opinionated wrapper to the official minimal Highcharts wrapper for Angular

Dependencies

FHI Angular HighchartsFHI Angular ComponetsFHI StyleBootstrapNgBootstrapHighchartsHighcharts AngularAngularNode/NPM
556.35.3.21711.44.01820/10 *
>4.146.35.3.21611.44.01718/10 *
>=3.1 <=4.146.25.3.21611.44.01718/10 *
34.065.3.21611.14.01718/10 *
23.15.95.3.21611.14.01718/10 *
1-551511.14.01618/9 *
0.7-551411.13.1.21518/9 *
0.6-551410.3.33.11518/9 *
0.5-551410.3.33.11518/9 *
0.4-5510.3.33.11518/9 *
0.3-5510.3.33.11518/9 *
0.2-4510.3.33.11518/9 *
0.1-4510.331416/8 *

For more dependencies see peerDependencies in package.json

* designsystem.fhi.no uses these Node/NPM versions, older versions may work, but then you're on your own :wink:

Get started

Install

Install with npm: npm install @folkehelseinstituttet/angular-highcharts

Add to app

After installing the package and all dependencies, add the following code to your app:

// In global css-file (usually style.scss)
@import "@folkehelseinstituttet/angular-highcharts/styles/import/all";
// In a standalone component or a shared module
import { FhiAngularHighchartsModule } from '@folkehelseinstituttet/angular-highcharts';
...
  imports: [FhiAngularHighchartsModule]
...
// In a component (.ts)
import { FhiDiagramOptions, FhiDiagramSerie, FhiDiagramTypeIds } from '@folkehelseinstituttet/angular-highcharts';
...
  data: FhiDiagramSerie[] = [...];
  diagramOptions: FhiDiagramOptions = {
    title: 'Diagram title',
    data: data,
    diagramTypeId: 'line'
  };
...
<!-- In a template -->
<fhi-angular-highcharts [diagramOptions]="diagramOptions"></fhi-angular-highcharts>

Remove warnings

Highcharts gives some warnings due to the use of CommonJs as described here: https://github.com/highcharts/highcharts/issues/14183

From one of the comments:

Highcharts uses the UMD pattern which includes AMD, and it is probably detected by angular. On the other hand, I don't think that using an ES6 module pattern will change anything in the performance matters, you would have to import the entire highcharts core anyway, so technically it will be the same package - I would suggest ignoring the warning by adding Highcharts to the allowedCommonJsDependencies property in the angular.json file.

This is where allowedCommonJsDependencies is located in angular.json

...
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "allowedCommonJsDependencies": ["highcharts"],
...

API

Inputs

InputTypeDefaultRequiredDescription
[diagramOptions]FhiDiagramOptions-yesAll properties used to configure the diagram. See FhiDiagramOptions for details. NB! The object sent in to @Input diagramOptions needs to be reassigned for change detection to kick in.

Outputs

OutputEvent typeDescription
(diagramTypeNavigation)FhiDiagramTypeIdsIf diagram type navigation i visible, this event will fire on every navigation. Outputs an existing diagram type id.
(metadataButtonClick)voidWhen link to "Om dataene" is clicked.

Interface FhiDiagramOptions

PropertyTypeDefaultRequiredDescription
activeDiagramTypestring-noID to specify default diagram type. Values defined by enum FhiDiagramTypeIds
controlsFhiDiagramControls-noProperties related to controls like navigation. See FhiDiagramControls for details.
footerFhiDiagramFooter-noProperties related to the footer below the diagram. See FhiDiagramFooter for details.
[openSource]booleantruenoIf false; the link to Highcharts.com disappears, AND LICENSE IS REQUIRED!
[series]FhiDiagramSerie[]-yesThe data used to render a diagram. See FhiDiagramSerie for details.
tableOrientationstring-noTranspose table by setting preferd orientation. Values defined by enum FhiTableOrientations
titlestring-yesThe title above the diagram.
unitsFhiDiagramUnit[]-noDecimal count, and metadata for y-axis and tooltip. See FhiDiagramUnit for details. Currently only diagram type columnAndLine supports two units, all other diagram types supports max 1 unit. See below this table for more info about using two units.
Using two units

Only diagram type columnAndLine supports two units, and to make it work

  • both units must have an id (see FhiDiagramUnit for more info about unit id)
  • at least two series must have unitId (with two unique values), and those ids must be present in the units array

Also nice to know

  • the first "unit" in "units" will always represent the left y-axis
  • and series associated with the first "unit" in "units" will always become columns

Interface FhiDiagramControls

PropertyTypeDefaultRequiredDescription
fullScreenButtonobject-noProperties related to fullScreenButton.
fullScreenButton.showbooleanfalseyesWhether to show a button which opens the diagram in full screen.
metadataButtonobject-noProperties related to metadata button.
metadataButton.showbooleanfalseyesWhether to show a button with an event for custom navigation to your metadata.
navigationobject-noProperties related to diagram type navigaton. PS. navigation.items will always contain table, therefore no navigation.items.table as part of the items interface.
navigation.items.chartTypesstring[]-noChart types to show in diagram type navigaton defined by enum ChartTypeIds.
navigation.items.mapTypesstring[]-noMap types to show in diagram type navigaton defined by enum MapTypeIds.
navigation.showbooleanfalseyesWhether to show diagram type navigaton.
navigation.typestring-noID to specify which type of navigation to use defined by enum DiagramTypeNavIds.
tableOrientationButtonobject-noProperties related to tableOrientationButton.
tableOrientationButton.showbooleanfalseyesWhether to show a button which toggles rows/columns in the diagram type table. Not implemented yet, so has no effect atm.

Interface FhiDiagramFooter

PropertyTypeDefaultRequiredDescription
creditsobject-noProperties related to source ref.
credits.hrefstring-yesLink to source ref.
credits.textstring-yesText to source ref.
disclaimerstring-noText at the bottom of the footer used to say something about uncertainty in the data shown in a diagram.
[flags]FhiDiagramFlag[]-noList of all flags used in FhiDiagramSerie[]. See FhiDiagramFlag for details.
lastUpdatedstring-noText after label Sist oppdatert in footer. Free format, but dd.mm.yyyy is the most common one.

Interface FhiDiagramSerie

PropertyTypeDefaultRequiredDescription
dataFhiDiagramSerieData[]-yesThe individual data points in a serie. See FhiDiagramSerieData for details.
namestring | string[]-yesThe name of the serie as shown in the legend. NB! The type string is an formatted string; pipe (|) is beeing used as seperator between category names if more than one category name is concatenated to one single serie name. To avoid dependency on a given separator, use an array of category names instead. NB! series can not contain duplicate serie.name
stackstring-yesThis option allows for grouping series in a stacked chart. Only applies to diagramTypeId barStacked and columnStacked.
unitIdnumber | string-noUsed to associate the serie with a unit. This only works if unit.id (FhiDiagramUnit) is set, and value is equal to serie.unitId.

Interface FhiDiagramSerieData

FhiDiagramSerieData is a custum type for FHI Angular Highcharts, but it is based on the smallest possible subset of the chart.series.[chart type].data object as described under nr 3. here (line chart used as example).

PropertyTypeDefaultRequiredDescription
namestring-yesThe name of the data point as shown in the tooltip.
ynumber | string-yesThe value of the data point. If type is string the data point is treated as a flagged value.

Interface FhiDiagramFlag

PropertyTypeDefaultRequiredDescription
labelstring-yesDescription of the flag, ie. Anonymized
symbolstring-yesSymbol representing the flag, ie. :.

Interface FhiDiagramUnit

PropertyTypeDefaultRequiredDescription
idnumber | string-noUsed to associate the unit with a serie. This only works if a serie.unitId (FhiDiagramSerie) is set, and value is equal to unit.id.
decimalsnumber-noThe decimal count. If undefined the decimal count is same as in the source data. If null, same as 0, ie. no decimals. Count is limited to 9 decimals because Highcharts tooltips fails if 10 decimals or more. A warning will be given in the consol if more than 9 decimals.
labelstring-yesThe vertical y-axis label, showing next to the axis line.
symbolstring-noSymbol before or after the value in both tooltip and y-axis.
positionstring-noWether the symbol i placed before or after the numbers in the diagram. Possible values: 'start' | 'end'
yAxisMaxnumber-noThe maximum value of the y-axis. If not set, the max value is automatically calculated. NB! Highcharts may override the value in some edge cases.
yAxisMinnumber-noThe minimum value of the y-axis. If not set, the min value is automatically calculated. NB! Highcharts may override the value in some edge cases.

Changelog

You find the changelog here.

Contribute

Read about how to contribute here

Demo

FAQs

Package last updated on 22 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc