Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Min and Max in X Axis for Time series chart is not working in chart js #6237

Closed
thetinshusasi opened this issue May 1, 2019 · 1 comment
Closed

Comments

@thetinshusasi
Copy link

thetinshusasi commented May 1, 2019

how can we set Min and Max values in time series chart , where X Axis contains Time values
I tried to set using ticks property but it doesn't work.

 xAxes: [{
            display: true,
            ticks: {
                fontColor: "#fff",
                min : new Date(1990,0,1,8,0,0),
                max : new Date(1990,0,1,21,0,0)
            },
            scaleLabel: {
                display: true,
                labelString: "Time Data",
                fontSize: 15,
                fontColor: "#fff"
            },
            type: "time",
            time: {
                displayFormats: {
                    quarter: 'h:mm a'
                }
            }
        }]
@nagix
Copy link
Contributor

nagix commented May 1, 2019

Use time.min and time.max options as described in the document. By the way, these options will be deprecated by #6097, and ticks.min and ticks.max options will be available in the time scale in the next release.

time: {
    min: new Date(1990, 0, 1, 8, 0, 0),
    max : new Date(1990, 0, 1, 21, 0, 0)
}

@nagix nagix closed this as completed May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants