forked from ddrilling/asb_cloud_front
Update chartjs version.
Replcae date-fns to moment adapter.
This commit is contained in:
parent
1db98b79e0
commit
89f7de7a49
20
package-lock.json
generated
20
package-lock.json
generated
@ -4234,14 +4234,14 @@
|
|||||||
"integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw=="
|
"integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw=="
|
||||||
},
|
},
|
||||||
"chart.js": {
|
"chart.js": {
|
||||||
"version": "3.0.2",
|
"version": "3.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.3.0.tgz",
|
||||||
"integrity": "sha512-DR0GmFSlxcFJp/w//ZmbxSduAkH/AqwxoiZxK97KHnWZf6gvsKWS3160WvNMMHYvzW9OXqGWjPjVh1Qu+xDabg=="
|
"integrity": "sha512-3pO3kL2st1Lzhw+HTGvDwcNYWustHwvApM/v7b2td6CrthyEygbPoXaN/iGZfUpfuovZfJ4dy129RCr39BR1Bg=="
|
||||||
},
|
},
|
||||||
"chartjs-adapter-date-fns": {
|
"chartjs-adapter-moment": {
|
||||||
"version": "1.1.0-beta.1",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/chartjs-adapter-date-fns/-/chartjs-adapter-date-fns-1.1.0-beta.1.tgz",
|
"resolved": "https://registry.npmjs.org/chartjs-adapter-moment/-/chartjs-adapter-moment-1.0.0.tgz",
|
||||||
"integrity": "sha512-VNhuZ86kXKOwh61CyRLP7hoFqAR7+gjnrtf7KYLt/Wfh3jIQs14l1h+nagtQoFaabIYIo6UD5/jJb2/J6zOPcw=="
|
"integrity": "sha512-PqlerEvQcc5hZLQ/NQWgBxgVQ4TRdvkW3c/t+SUEQSj78ia3hgLkf2VZ2yGJtltNbEEFyYGm+cA6XXevodYvWA=="
|
||||||
},
|
},
|
||||||
"chartjs-plugin-datalabels": {
|
"chartjs-plugin-datalabels": {
|
||||||
"version": "2.0.0-rc.1",
|
"version": "2.0.0-rc.1",
|
||||||
@ -10473,7 +10473,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"hosted-git-info": {
|
"hosted-git-info": {
|
||||||
"version": "2.8.8",
|
"version": "2.8.8",
|
||||||
"resolved": "",
|
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
|
||||||
|
"integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"normalize-package-data": {
|
"normalize-package-data": {
|
||||||
@ -16861,7 +16862,8 @@
|
|||||||
},
|
},
|
||||||
"ssri": {
|
"ssri": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.1",
|
||||||
"resolved": "",
|
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"figgy-pudding": "^3.5.1"
|
"figgy-pudding": "^3.5.1"
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
"@testing-library/react": "^11.2.6",
|
"@testing-library/react": "^11.2.6",
|
||||||
"@testing-library/user-event": "^12.8.3",
|
"@testing-library/user-event": "^12.8.3",
|
||||||
"antd": "^4.15.0",
|
"antd": "^4.15.0",
|
||||||
"chart.js": "^3.0.2",
|
"chart.js": "^3.3.0",
|
||||||
"chartjs-adapter-date-fns": "^1.1.0-beta.1",
|
"chartjs-adapter-moment": "^1.0.0",
|
||||||
"chartjs-plugin-datalabels": "^2.0.0-rc.1",
|
"chartjs-plugin-datalabels": "^2.0.0-rc.1",
|
||||||
"craco-less": "^1.17.1",
|
"craco-less": "^1.17.1",
|
||||||
"date-fns": "^2.20.0",
|
"date-fns": "^2.20.0",
|
||||||
|
@ -10,13 +10,13 @@ import {
|
|||||||
ChartData,
|
ChartData,
|
||||||
ChartTypeRegistry,
|
ChartTypeRegistry,
|
||||||
ChartOptions} from 'chart.js'
|
ChartOptions} from 'chart.js'
|
||||||
import 'chartjs-adapter-date-fns';
|
import 'chartjs-adapter-moment';
|
||||||
import ChartDataLabels from 'chartjs-plugin-datalabels';
|
import ChartDataLabels from 'chartjs-plugin-datalabels';
|
||||||
|
|
||||||
Chart.register( TimeScale, LinearScale, LineController, LineElement, PointElement, Legend, ChartDataLabels );
|
Chart.register( TimeScale, LinearScale, LineController, LineElement, PointElement, Legend, ChartDataLabels );
|
||||||
|
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
//maintainAspectRatio: false,
|
responsive: true,
|
||||||
aspectRatio: 0.45,
|
aspectRatio: 0.45,
|
||||||
animation: false,
|
animation: false,
|
||||||
events: ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'],
|
events: ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'],
|
||||||
@ -25,8 +25,6 @@ const defaultOptions = {
|
|||||||
type: 'time',
|
type: 'time',
|
||||||
reverse: true,
|
reverse: true,
|
||||||
time: {
|
time: {
|
||||||
//unit: 'second',
|
|
||||||
//round:'second',
|
|
||||||
stepSize: 20,
|
stepSize: 20,
|
||||||
displayFormats: {
|
displayFormats: {
|
||||||
millisecond: 'HH:mm:ss.SSS',
|
millisecond: 'HH:mm:ss.SSS',
|
||||||
@ -40,7 +38,6 @@ const defaultOptions = {
|
|||||||
year: 'yyyy.MM',
|
year: 'yyyy.MM',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
//position:'center',
|
|
||||||
grid:{
|
grid:{
|
||||||
drawTicks: false,
|
drawTicks: false,
|
||||||
},
|
},
|
||||||
@ -64,6 +61,14 @@ const defaultOptions = {
|
|||||||
hoverRadius:5,
|
hoverRadius:5,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
plugins:{
|
||||||
|
legend:{
|
||||||
|
display: false,
|
||||||
|
},
|
||||||
|
datalabels: {
|
||||||
|
display: false,
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ChartTimeData = ChartData<keyof ChartTypeRegistry, {
|
export type ChartTimeData = ChartData<keyof ChartTypeRegistry, {
|
||||||
|
Loading…
Reference in New Issue
Block a user