Question T17664
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Dashboard axis displays time for date input

Scale numbers

created 9 months ago

The results panel shows scales in some graphics representing natural numbers (the number of users in my example).
There are no half or negative users, but the scales show them.
The scale 0-0,5-1-1,5 etc is automatically created, but wrong. How can i change that to use integers only? is there a configuration option?

Clipboard-File-1.png
Clipboard-File-2.png

Answers approved by surveyjs Support

created 9 months ago

Hello Wolfgang,
SurveyJS Dashboard uses Plotly.js to visualize data in charts. You can implement the PlotlySetup.onPlotCreating event and format the x and y-axis.

JavaScript
SurveyAnalytics.PlotlySetup.onPlotCreating.add(function(s, o) { if(s.type === "histogram") { o.layout.xaxis = { tickmode: "linear", tick0: 1, dtick: 1 } o.layout.yaxis = { tickmode: "linear", tick0: 1, dtick: 1 } } });

Let me know if you have further questions.