apexcharts
Advanced tools
Comparing version 1.3.17 to 1.3.18
@@ -144,3 +144,4 @@ // For a detailed explanation regarding each configuration property, visit: | ||
"/node_modules/", | ||
"/tests/unit/data/" | ||
"/tests/unit/data/", | ||
"/tests/unit/utils/" | ||
], | ||
@@ -147,0 +148,0 @@ |
{ | ||
"name": "apexcharts", | ||
"description": "A JavaScript Chart Library", | ||
"version": "1.3.17", | ||
"version": "1.3.18", | ||
"main": "dist/apexcharts.min.js", | ||
@@ -6,0 +6,0 @@ "directories": { |
@@ -121,3 +121,3 @@ import Graphics from '../Graphics' | ||
if (!isFinite(label)) label = '' | ||
if (label.indexOf('NaN') >= 0 || label.indexOf('undefined') >= 0) label = '' | ||
@@ -406,2 +406,13 @@ let offsetYCorrection = 28 | ||
if (xAxisTexts.length > 0) { | ||
let firstLabelPos = xAxisTexts[0].getBBox() | ||
let lastLabelPos = xAxisTexts[xAxisTexts.length - 1].getBBox() | ||
if (firstLabelPos.x < -25) { | ||
xAxisTexts[0].remove() | ||
} | ||
if (lastLabelPos.x + lastLabelPos.width > w.globals.gridWidth + 15) { | ||
xAxisTexts[xAxisTexts.length - 1].remove() | ||
} | ||
} | ||
if (yAxisTextsInversed.length > 0) { | ||
@@ -408,0 +419,0 @@ // truncate y axis in bar chart |
@@ -765,3 +765,4 @@ import Bar from '../charts/Bar' | ||
let ts = new TimeScale(this.ctx) | ||
ts.calculateTimeScaleTicks() | ||
const formattedTimeScale = ts.calculateTimeScaleTicks(w.globals.minX, w.globals.maxX) | ||
ts.recalcDimensionsBasedOnFormat(formattedTimeScale) | ||
} | ||
@@ -768,0 +769,0 @@ } |
@@ -18,3 +18,3 @@ import DateTime from '../utils/DateTime' | ||
calculateTimeScaleTicks () { | ||
calculateTimeScaleTicks (minX, maxX) { | ||
let w = this.w | ||
@@ -31,6 +31,6 @@ | ||
const daysDiff = (w.globals.maxX - w.globals.minX) / (1000 * 60 * 60 * 24) | ||
const daysDiff = (maxX - minX) / (1000 * 60 * 60 * 24) | ||
this.determineInterval(daysDiff) | ||
const timeIntervals = dt.getTimeUnitsfromTimestamp(w.globals.minX, w.globals.maxX) | ||
const timeIntervals = dt.getTimeUnitsfromTimestamp(minX, maxX) | ||
@@ -192,2 +192,7 @@ const daysWidthOnXAxis = w.globals.gridWidth / daysDiff | ||
return filteredTimeScale | ||
} | ||
recalcDimensionsBasedOnFormat (filteredTimeScale) { | ||
const w = this.w | ||
const reformattedTimescaleArray = this.formatDates(filteredTimeScale) | ||
@@ -204,4 +209,2 @@ | ||
dimensions.plotCoords() | ||
return filteredTimeScale | ||
} | ||
@@ -208,0 +211,0 @@ |
@@ -1,23 +0,13 @@ | ||
import ApexCharts from '../../dist/apexcharts.min.js' | ||
import Core from '../../src/modules/Core.js' | ||
import seriesxy from './data/seriesxy.js' | ||
import { createChart } from './utils/utils.js' | ||
describe("Parse Data", () => { | ||
function createChart(type, series) { | ||
document.body.innerHTML = '<div id="chart" />'; | ||
const chart = new ApexCharts(document.querySelector("#chart"), { | ||
chart: { | ||
type | ||
}, | ||
series | ||
}) | ||
return chart | ||
} | ||
it("should parse data for cartesian charts", () => { | ||
const chart = createChart('line', seriesxy) | ||
chart.w.globals.series = [] | ||
chart.w.globals.seriesX = [] | ||
chart.w.globals.labels = [] | ||
const core = new Core(document.querySelector("#chart"), chart) | ||
@@ -34,2 +24,5 @@ const w = core.parseDataAxisCharts(seriesxy, seriesxy, chart) | ||
const chart = createChart('donut', series) | ||
chart.w.globals.series = [] | ||
chart.w.globals.seriesNames = [] | ||
@@ -36,0 +29,0 @@ const core = new Core(document.querySelector("#chart"), chart) |
Sorry, the diff of this file is too big to display
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
1292235
103
16672