diff --git a/frappe/public/js/frappe/utils/utils.js b/frappe/public/js/frappe/utils/utils.js index ae4f223c19..3730fe8080 100644 --- a/frappe/public/js/frappe/utils/utils.js +++ b/frappe/public/js/frappe/utils/utils.js @@ -1237,7 +1237,7 @@ Object.assign(frappe.utils, { chart_args[key] = custom_options[key]; } } - + frappe.utils.set_space_label_ratio(chart_args); return new frappe.Chart(wrapper, chart_args); }, @@ -1245,7 +1245,11 @@ Object.assign(frappe.utils, { const default_country = frappe.sys_defaults.country; return frappe.utils.shorten_number(label, country || default_country, 3); }, - + set_space_label_ratio(chart_args) { + if (chart_args.data.labels.length > 10) { + chart_args["axisOptions"]["seriesLabelSpaceRatio"] = 0.9; + } + }, generate_route(item) { const type = item.type.toLowerCase(); if (type === "doctype") { diff --git a/package.json b/package.json index 7682d8adce..6ae5fc10fc 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "esbuild-plugin-vue3": "^0.3.0", "fast-deep-equal": "^2.0.1", "fast-glob": "^3.2.5", - "frappe-charts": "2.0.0-rc22", + "frappe-charts": "^2.0.0-rc26", "frappe-datatable": "1.18.1", "frappe-gantt": "^0.6.0", "highlight.js": "^10.4.1", diff --git a/yarn.lock b/yarn.lock index 93ecd1922d..9d06999464 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1485,10 +1485,10 @@ fraction.js@^4.3.6: resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.7.tgz#06ca0085157e42fda7f9e726e79fefc4068840f7" integrity sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew== -frappe-charts@2.0.0-rc22: - version "2.0.0-rc22" - resolved "https://registry.yarnpkg.com/frappe-charts/-/frappe-charts-2.0.0-rc22.tgz#9a5a747febdc381a1d4d7af96e89cf519dfba8c0" - integrity sha512-N7f/8979wJCKjusOinaUYfMxB80YnfuVLrSkjpj4LtyqS0BGS6SuJxUnb7Jl4RWUFEIs7zEhideIKnyLeFZF4Q== +frappe-charts@^2.0.0-rc26: + version "2.0.0-rc26" + resolved "https://registry.yarnpkg.com/frappe-charts/-/frappe-charts-2.0.0-rc26.tgz#9632d620b92f2043cebd192a8899119f5715524b" + integrity sha512-0vyXcwcekIeYA6pxCHGcRdG8llC6hpGR91nkbwRGSnBYMKomX2AQtfgTlIKMrE9nmAkewJeZsTx1scni8Ry0iA== frappe-datatable@1.18.1: version "1.18.1"