Skip to content

Commit

Permalink
Highcharts number formatting based on language
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistry authored and Mistry committed Feb 28, 2024
1 parent 2f24f16 commit 806d6df
Showing 1 changed file with 31 additions and 14 deletions.
45 changes: 31 additions & 14 deletions src/components/editor/chart-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,37 @@ export default class ChartEditorV extends Vue {
clearEditor(): void {
// reset to clear modal editor options
this.modalEditor.editor.chart.options.setAll({
title: {
text: `Chart ${this.chartConfigs.length + 1}`
},
subtitle: {
text: ''
},
credits: {
enabled: false
}
});
// resets and clears datatable section
if (this.lang === 'en') {
this.modalEditor.editor.chart.options.setAll({
title: {
text: `Chart ${this.chartConfigs.length + 1}`
},
subtitle: {
text: ''
},
credits: {
enabled: false
},
lang: {
thousandsSep: ','
}
});
} else {
this.modalEditor.editor.chart.options.setAll({
title: {
text: `Chart ${this.chartConfigs.length + 1}`
},
subtitle: {
text: ''
},
credits: {
enabled: false
},
lang: {
thousandsSep: ' '
}
});
} // resets and clears datatable section
const defaultTableData = `"Column 1";"Column 2"\n" "";" "`;
this.modalEditor.editor.dataTable.loadCSV({ csv: defaultTableData });
}
Expand All @@ -163,7 +181,6 @@ export default class ChartEditorV extends Vue {
// Add chart config to ZIP file.
this.configFileStructure.charts[this.lang].file(`${chart.title.text}.json`, JSON.stringify(chart, null, 4));
this.chartConfigs.push(chartConfig);
}
this.onChartsEdited();
Expand Down

0 comments on commit 806d6df

Please sign in to comment.