You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/axes/cartesian/time.md
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -161,6 +161,35 @@ let chart = new Chart(ctx, {
161
161
});
162
162
```
163
163
164
+
## Changing the scale type from Time scale to Logarithmic/Linear scale.
165
+
166
+
When changing the scale type from Time scale to Logarithmic/Linear scale, you need to add `bounds: 'ticks'` to the scale options. Changing the `bounds` parameter is necessary because its default value is the `'data'` for the Time scale.
167
+
168
+
Initial config:
169
+
170
+
```javascript
171
+
constchart=newChart(ctx, {
172
+
type:'line',
173
+
data: data,
174
+
options: {
175
+
scales: {
176
+
x: {
177
+
type:'time',
178
+
}
179
+
}
180
+
}
181
+
});
182
+
```
183
+
184
+
Scale update:
185
+
186
+
```javascript
187
+
chart.options.scales.x= {
188
+
type:'logarithmic',
189
+
bounds:'ticks'
190
+
};
191
+
```
192
+
164
193
## Internal data format
165
194
166
195
Internally time scale uses milliseconds since epoch
0 commit comments