Comments (9)
@itnassol I want t do the same. Can you please share your code? It will be helpful.
Thanks :)
I needed the flexibility of different zoom levels, I achieved this by setting up a drop down that asks how many years to display, 1 year 5 years etc, then calculated the start date and set up the code as follows.
xAxes:[
{
type: 'time',
time: {
'zoom') { ?>min: '',
tooltipFormat: 'll',
displayFormats: {
quarter: 'MMM YYYY',
}
},
by echoing the integer of the number of years the graph "zooms" in but the old data is still there to scroll to.
hope this helps.
from chartjs-plugin-zoom.
Have you tried setting the suggestedMin
and suggestedMax
scale ticks settings?
http://www.chartjs.org/docs/#scales-linear-scale
from chartjs-plugin-zoom.
I will try that, thank you for the suggestion
from chartjs-plugin-zoom.
Hi,
I took a look at that and it seems that is for linear scales, my fault my X axis is time based.
However there is in the documentation a Min and Max for the time scale, just not sure of the format if anyone can help, that would be good.
scales: {
xAxes:[
{
type: 'time',
time: {
displayFormats: {
quarter: 'MMM YYYY',
min: '04 2010', /// This is the fprmat I can't find.
}
},
from chartjs-plugin-zoom.
Finally worked this out.
In the scales options section you need to add a min integer when used with the zoom function this then still renders the graph outside of the canvas, ready for panning.
scales: {
xAxes:[
{
type: 'time',
time: {
min: '2',
tooltipFormat: 'll',
displayFormats: {
quarter: 'MMM YYYY',
}
},
As long as your "Type" is time this worked for me.
from chartjs-plugin-zoom.
@itnassol I want t do the same. Can you please share your code? It will be helpful.
Thanks :)
from chartjs-plugin-zoom.
@itnassol I want t do the same. Can you please share your code? It will be helpful.
Thanks :)
What do you mean by specifying min '2' with time-series data?
from chartjs-plugin-zoom.
@itnassol Thanks for your reply but I am not able to understand 'zoom') { ?>min: '',
Can you please explain this.
Thanks
from chartjs-plugin-zoom.
@sureshzebpay Probably it's too late, I am having the same issue.
What @itnassol means by min
value is the minimum value from which your chart should start displaying data.
so if you label is [1,2,3,4,5,6,7,8,9,10];
and you set min value in ticks
scales: {
xAxes: [
{
ticks: {
min: '4'
Then your chart will start displaying data from 4
on the x-axis, which means it won't start with 1
but from 4
in the labels.
So basically you are setting the range of the charts from 4(min - starting point) to 10 (being the last element)
from chartjs-plugin-zoom.
Related Issues (20)
- onZoomStart is not called for pinch
- Zooming in breaks scrolling on mobile device
- Accept ratio of XY while zoom in mobile device horizontally or vertically
- Want to implement rectangle selection without zoom.
- LineChart disappears while zooming in if spanGaps: true and non-null datapoints are out of bounds
- minRange for Category HOT 3
- After zooming in too much, straight line shifts upwards HOT 1
- Zooming in over axis does not reset y-axis ticks back to initial limits HOT 1
- import zoomPlugin from 'chartjs-plugin-zoom' causing GET 500 Error but still working HOT 2
- Some ticks disappear when the X axis is moved.
- Zoom reset for scales built with suggestedMin and suggestedMax
- Graph grid and axes jittering when panning on one axis
- getZoomLevel doesn't appear to be exported HOT 1
- Overlap the axis
- Chartjs-plugin-zoom drag issue
- Reduce the number of dependencies HOT 2
- Inconsistent behavior when using limits and new data points
- Changing zoom mode (drag) resets the zoom level
- Pan function does not work properly when there are many points HOT 1
- Zooming in on a line chart on the category axis makes the line disappear
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chartjs-plugin-zoom.