Monday, 21 December 2020

Custom formatting of xticks in Ploty.js and Vue

I'm trying to apply custom formatting for xticks and yticks in Plotly.js charts(using Vue wrapper for that library). I tried using the standard d3 style formatting, but was not able to apply the format I'm trying achieve. I used:

xaxis: {
          tickformat: ",.2f",
        },

So that 200000 is formatted as 200,000.00 but my desired format is to have space as thousands separator so that 200000 becomes 200 000.00. I cant find how that works in d3 style formatting. Is there a straightforward way to apply the formatting to the values displayed on the plot?

Here is my example: https://codesandbox.io/s/vuetify-playground-barchart-pw78w?file=/src/layout.vue



from Custom formatting of xticks in Ploty.js and Vue

No comments:

Post a Comment