Skip to content

Commit af9c541

Browse files
t47iokimili
authored andcommitted
fix wrong set DEFAULT_AXIS_CHART_TYPE
1 parent fddfb16 commit af9c541

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

dist/frappe-charts.esm.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ function getExtraWidth(m) {
122122
const INIT_CHART_UPDATE_TIMEOUT = 700;
123123
const CHART_POST_ANIMATE_TIMEOUT = 400;
124124

125+
const DEFAULT_AXIS_CHART_TYPE = 'line';
126+
const AXIS_DATASET_CHART_TYPES = ['line', 'bar'];
127+
125128
const AXIS_LEGEND_BAR_SIZE = 100;
126129

127130
const BAR_CHART_SPACE_RATIO = 0.5;
@@ -2969,6 +2972,7 @@ function dataPrep(data, type) {
29692972

29702973
// Set type
29712974
if(!d.chartType ) {
2975+
if(!AXIS_DATASET_CHART_TYPES.includes(type)) type = DEFAULT_AXIS_CHART_TYPE;
29722976
d.chartType = type;
29732977
}
29742978

docs/assets/js/data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export const moonData = {
150150
names: ["Ganymede", "Callisto", "Io", "Europa"],
151151
masses: [14819000, 10759000, 8931900, 4800000],
152152
distances: [1070.412, 1882.709, 421.700, 671.034],
153-
diameters: [5262.4, 4820.6,3637.4, 3121.6],
153+
diameters: [5262.4, 4820.6, 3637.4, 3121.6],
154154
};
155155

156156
// const jupiterMoons = {

src/js/utils/axis-chart-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function dataPrep(data, type) {
3838

3939
// Set type
4040
if(!d.chartType ) {
41-
if(!AXIS_DATASET_CHART_TYPES.includes(type)) type === DEFAULT_AXIS_CHART_TYPE;
41+
if(!AXIS_DATASET_CHART_TYPES.includes(type)) type = DEFAULT_AXIS_CHART_TYPE;
4242
d.chartType = type;
4343
}
4444

0 commit comments

Comments
 (0)