abstract-chart
Advanced tools
Comparing version 3.2.0 to 3.2.1
@@ -20,2 +20,3 @@ import * as AbstractImage from "abstract-image"; | ||
readonly gridThickness: number; | ||
readonly font: string; | ||
readonly fontSize: number; | ||
@@ -22,0 +23,0 @@ readonly labelLayout: LabelLayout; |
@@ -27,3 +27,3 @@ "use strict"; | ||
function createChart(props) { | ||
const { width = 600, height = 400, chartPoints = [], chartLines = [], chartStack = createChartStack({}), xAxisBottom = Axis.createLinearAxis(0, 100, ""), xAxisTop = undefined, yAxisLeft = Axis.createLinearAxis(0, 100, ""), yAxisRight = undefined, backgroundColor = AbstractImage.white, gridColor = AbstractImage.gray, gridThickness = 1, fontSize = 12, labelLayout = "original", } = props || {}; | ||
const { width = 600, height = 400, chartPoints = [], chartLines = [], chartStack = createChartStack({}), xAxisBottom = Axis.createLinearAxis(0, 100, ""), xAxisTop = undefined, yAxisLeft = Axis.createLinearAxis(0, 100, ""), yAxisRight = undefined, backgroundColor = AbstractImage.white, gridColor = AbstractImage.gray, gridThickness = 1, font = "Arial", fontSize = 12, labelLayout = "original", } = props || {}; | ||
return { | ||
@@ -42,2 +42,3 @@ width, | ||
gridThickness, | ||
font, | ||
fontSize, | ||
@@ -303,3 +304,3 @@ labelLayout, | ||
AbstractImage.createPolyLine(points, l.color, l.thickness), | ||
AbstractImage.createText(last, l.label, "Arial", chart.fontSize, AbstractImage.black, "normal", 0, "center", "right", "down", 0, AbstractImage.black, false), | ||
AbstractImage.createText(last, l.label, chart.font, chart.fontSize, AbstractImage.black, "normal", 0, "center", "right", "down", 0, AbstractImage.black, false), | ||
]); | ||
@@ -318,3 +319,3 @@ }); | ||
shape, | ||
AbstractImage.createText(position, p.label, "Arial", chart.fontSize, AbstractImage.black, "normal", 0, "center", "right", "down", 0, AbstractImage.black, false), | ||
AbstractImage.createText(position, p.label, chart.font, chart.fontSize, AbstractImage.black, "normal", 0, "center", "right", "down", 0, AbstractImage.black, false), | ||
]); | ||
@@ -360,3 +361,3 @@ }); | ||
const position = AbstractImage.createPoint(Axis.transformValue(l, xMin, xMax, xAxis), y); | ||
return AbstractImage.createText(position, formatNumber(l), "Arial", chart.fontSize, AbstractImage.black, "normal", 0, "center", "uniform", growVertical, 0, AbstractImage.black, false); | ||
return AbstractImage.createText(position, formatNumber(l), chart.font, chart.fontSize, AbstractImage.black, "normal", 0, "center", "uniform", growVertical, 0, AbstractImage.black, false); | ||
}); | ||
@@ -368,3 +369,3 @@ return AbstractImage.createGroup("Labels", xLabels); | ||
const position = AbstractImage.createPoint(x, y); | ||
return AbstractImage.createText(position, label, "Arial", chart.fontSize, AbstractImage.black, "normal", 0, "center", horizontalGrowthDirection, verticalGrowthDirection, 0, AbstractImage.black, false); | ||
return AbstractImage.createText(position, label, chart.font, chart.fontSize, AbstractImage.black, "normal", 0, "center", horizontalGrowthDirection, verticalGrowthDirection, 0, AbstractImage.black, false); | ||
} | ||
@@ -385,3 +386,3 @@ exports.generateXAxisLabel = generateXAxisLabel; | ||
const position = AbstractImage.createPoint(x, Axis.transformValue(l, yMin, yMax, yAxis)); | ||
return AbstractImage.createText(position, formatNumber(l), "Arial", chart.fontSize, AbstractImage.black, "normal", 0, "center", growHorizontal, "uniform", 0, AbstractImage.black, false); | ||
return AbstractImage.createText(position, formatNumber(l), chart.font, chart.fontSize, AbstractImage.black, "normal", 0, "center", growHorizontal, "uniform", 0, AbstractImage.black, false); | ||
}); | ||
@@ -393,3 +394,3 @@ return AbstractImage.createGroup("Labels", yLabels); | ||
const position = AbstractImage.createPoint(x, y); | ||
return AbstractImage.createText(position, label, "Arial", chart.fontSize, AbstractImage.black, "normal", -90, "center", horizontalGrowthDirection, verticalGrowthDirection, 0, AbstractImage.black, false); | ||
return AbstractImage.createText(position, label, chart.font, chart.fontSize, AbstractImage.black, "normal", -90, "center", horizontalGrowthDirection, verticalGrowthDirection, 0, AbstractImage.black, false); | ||
} | ||
@@ -396,0 +397,0 @@ exports.generateYAxisLabel = generateYAxisLabel; |
{ | ||
"name": "abstract-chart", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "Drawing charts using multiple unit of measure axes as coordinate system", | ||
@@ -25,3 +25,3 @@ "repository": "https://github.com/dividab/abstract-visuals/tree/master/packages/abstract-chart", | ||
}, | ||
"gitHead": "4e74542bd1f1968608c09e0bff052881e511d76c" | ||
"gitHead": "ce86a5ef9a7db865039dc76458f984a9991a5c05" | ||
} |
@@ -24,2 +24,3 @@ import * as AbstractImage from "abstract-image"; | ||
readonly gridThickness: number; | ||
readonly font: string; | ||
readonly fontSize: number; | ||
@@ -45,2 +46,3 @@ readonly labelLayout: LabelLayout; | ||
gridThickness = 1, | ||
font = "Arial", | ||
fontSize = 12, | ||
@@ -62,2 +64,3 @@ labelLayout = "original", | ||
gridThickness, | ||
font, | ||
fontSize, | ||
@@ -524,3 +527,3 @@ labelLayout, | ||
l.label, | ||
"Arial", | ||
chart.font, | ||
chart.fontSize, | ||
@@ -559,3 +562,3 @@ AbstractImage.black, | ||
p.label, | ||
"Arial", | ||
chart.font, | ||
chart.fontSize, | ||
@@ -631,3 +634,3 @@ AbstractImage.black, | ||
formatNumber(l), | ||
"Arial", | ||
chart.font, | ||
chart.fontSize, | ||
@@ -660,3 +663,3 @@ AbstractImage.black, | ||
label, | ||
"Arial", | ||
chart.font, | ||
chart.fontSize, | ||
@@ -707,3 +710,3 @@ AbstractImage.black, | ||
formatNumber(l), | ||
"Arial", | ||
chart.font, | ||
chart.fontSize, | ||
@@ -736,3 +739,3 @@ AbstractImage.black, | ||
label, | ||
"Arial", | ||
chart.font, | ||
chart.fontSize, | ||
@@ -739,0 +742,0 @@ AbstractImage.black, |
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
99311
1596