Skip to content

How to reversed yAxis in VueUiXy #194

Answered by graphieros
jougisljs asked this question in Q&A
Discussion options

You must be logged in to vote

@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

Comment options

You must be logged in to vote
2 replies
@jougisljs
Comment options

@jougisljs
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jougisljs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
usage question Questions related to library usage
2 participants