@forter/chart
Advanced tools
Comparing version 5.8.2 to 5.8.3
@@ -6,2 +6,10 @@ # Change Log | ||
## [5.8.3](https://github.com/forter/web-components/compare/@forter/chart@5.8.2...@forter/chart@5.8.3) (2021-10-17) | ||
**Note:** Version bump only for package @forter/chart | ||
## [5.8.2](https://github.com/forter/web-components/compare/@forter/chart@5.8.1...@forter/chart@5.8.2) (2021-10-14) | ||
@@ -8,0 +16,0 @@ |
import { cloneDeep, merge } from 'lodash-es'; | ||
const SUPPORTED_CHART_TYPES = ['line', 'bar']; | ||
const font = { | ||
family: '"Open Sans"' | ||
}; | ||
const DEFAULT_OPTIONS = { | ||
@@ -31,3 +34,4 @@ maintainAspectRatio: false, | ||
color: '#8696AC', | ||
padding: 0 | ||
padding: 0, | ||
font | ||
}, | ||
@@ -53,3 +57,4 @@ border: false, | ||
color: '#8696AC', | ||
maxRotation: 0 | ||
maxRotation: 0, | ||
font | ||
} | ||
@@ -56,0 +61,0 @@ } |
@@ -1,15 +0,7 @@ | ||
import { get, merge } from 'lodash-es'; | ||
import { merge } from 'lodash-es'; | ||
var insertYAxisTicks = ((config, chartJSConfig) => { | ||
const symbol = get(config, 'style.options.scales.y.ticks.forterSymbol'); | ||
/** | ||
* forterSymbol | ||
*/ | ||
if (symbol) { | ||
const callback = function (value, index, values) { | ||
return `${value}${symbol}`; | ||
}; | ||
const callbackObject = { | ||
if (config.yAxisFormattingOptions) { | ||
/* eslint-disable */ | ||
const formatObject = { | ||
options: { | ||
@@ -19,3 +11,3 @@ scales: { | ||
ticks: { | ||
callback | ||
format: config.yAxisFormattingOptions | ||
} | ||
@@ -26,3 +18,3 @@ } | ||
}; | ||
chartJSConfig = merge(chartJSConfig, callbackObject); | ||
chartJSConfig = merge(chartJSConfig, formatObject); | ||
} | ||
@@ -29,0 +21,0 @@ |
{ | ||
"name": "@forter/chart", | ||
"version": "5.8.2", | ||
"version": "5.8.3", | ||
"description": "chart from Forter Components", | ||
@@ -59,3 +59,3 @@ "author": "Forter Developers", | ||
}, | ||
"gitHead": "dc00a7592bde32376ad15b44bba06f9a6b51a1f8" | ||
"gitHead": "bea5254128eee4dc85eb62ca3098537b9782d681" | ||
} |
@@ -5,2 +5,6 @@ import { merge, cloneDeep } from 'lodash-es'; | ||
const font = { | ||
family: '"Open Sans"' | ||
}; | ||
const DEFAULT_OPTIONS = { | ||
@@ -33,3 +37,4 @@ maintainAspectRatio: false, | ||
color: '#8696AC', | ||
padding: 0 | ||
padding: 0, | ||
font | ||
}, | ||
@@ -56,2 +61,3 @@ border: false, | ||
maxRotation: 0, | ||
font | ||
} | ||
@@ -58,0 +64,0 @@ } |
@@ -1,21 +0,10 @@ | ||
import { get, merge } from 'lodash-es'; | ||
import { merge } from 'lodash-es'; | ||
export default (config, chartJSConfig) => { | ||
const symbol = get(config, 'style.options.scales.y.ticks.forterSymbol'); | ||
/** | ||
* forterSymbol | ||
*/ | ||
if (symbol) { | ||
const callback = function(value, index, values) { | ||
return `${value}${symbol}`; | ||
}; | ||
const callbackObject = { options: { scales: { y: { ticks: { callback } } } } }; | ||
chartJSConfig = merge(chartJSConfig, callbackObject); | ||
if (config.yAxisFormattingOptions) { | ||
/* eslint-disable */ | ||
const formatObject = { options: { scales: { y: { ticks: { format: config.yAxisFormattingOptions } } } } }; | ||
chartJSConfig = merge(chartJSConfig, formatObject); | ||
} | ||
return chartJSConfig; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152575
2837