logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
tom_lai007  
#1 Posted : Saturday, April 4, 2020 10:02:04 AM(UTC)
tom_lai007

Rank: Newbie

Groups: Registered
Joined: 4/4/2020(UTC)
Posts: 0
Taiwan, Province Of China
Location: Taichung

For example, I want a percentage line chart. How do I set the minimum and maximum values on the Y axis to 0 and 100?

Thanks~
epf  
#2 Posted : Monday, April 6, 2020 9:28:59 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
This depends on the chart type, for ChartJS, select the ChartJS view and edit a custom template and add min, max and stepSize:
Code:
                    yAxes: [
                            
                            {
                                id: 'yaxis-1',
                                display: true,
                                stacked: false,
                                scaleLabel: {
                                    display: true,
                                    labelString: 'y title'
                                },
                               ticks: {
                                    min:50,
                                    max:200,
                                    stepSize:5,
                                    callback: function (label, index, labels) {
                                        if (false) return d3.timeFormat(',.0f')(new Date(label));
                                        return d3.format(',.0f')(label).valueFormat();
                                    }
                                }
                            },

as explained in https://www.chartjs.org/...es/cartesian/linear.html

It is different for NVD3 or Plotly:
Code:
                    xaxis: {
                        range:[50,200],
                        title: 'x title',
                        tickformat: ',.0f',
                    },
                    yaxis: {
                        range:[500,5000],
                        title: 'y title',
                        tickformat: ',.0f',
                    },


These options will be standard in the incoming 5.5 version (RC published soon...)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.