-
Notifications
You must be signed in to change notification settings - Fork 97
How to reversed yAxis in VueUiXy #194
-
How to reversed yAxis in VueUiXy
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
graphieros
May 26, 2025
@jougisljs
Thank you for the screenshot.
Try setting all your dataset values to negative, and using formatters to display values as positive:
const config = ref({ // ...rest of your config chart: { grid: { labels: { yAxis: { formatter: ({ value }) => { return Math.abs(value) } } } }, tooltip: { customFormat: ({ datapoint }) => { let html = ""; datapoint.forEach(d => { html += `<li>${d.name}: ${Math.abs(d.value)}</li>` }) return `<ul>${html}</ul>` ...
Replies: 2 comments 2 replies
-
Can you be more specific ?
Beta Was this translation helpful? Give feedback.
All reactions
2 replies
-
By default, the origin of the y-axis is at the bottom left. How can I set it to the top left?
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
@jougisljs
Thank you for the screenshot.
Try setting all your dataset values to negative, and using formatters to display values as positive:
const config = ref({ // ...rest of your config chart: { grid: { labels: { yAxis: { formatter: ({ value }) => { return Math.abs(value) } } } }, tooltip: { customFormat: ({ datapoint }) => { let html = ""; datapoint.forEach(d => { html += `<li>${d.name}: ${Math.abs(d.value)}</li>` }) return `<ul>${html}</ul>` } } }, line: { labels: { formatter: ({ value }) => { return Math.abs(value) } } }, })
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
0 replies
Answer selected by
jougisljs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment