mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 02:42:48 +00:00
fixed chart
This commit is contained in:
@@ -2,20 +2,15 @@ import React from 'react';
|
|||||||
import {Link} from 'react-router';
|
import {Link} from 'react-router';
|
||||||
|
|
||||||
import Loading from '../utils/Loading';
|
import Loading from '../utils/Loading';
|
||||||
import _chartjs from 'chart.js';
|
|
||||||
import Chart from 'react-chartjs';
|
import Chart from 'react-chartjs';
|
||||||
import {
|
import { ChartOptions, DataTemplate } from './chartOptions';
|
||||||
ChartOptions,
|
|
||||||
DataTemplate
|
|
||||||
}
|
|
||||||
from './chartOptions';
|
|
||||||
|
|
||||||
import './SensorInfo.scss';
|
import './SensorInfo.scss';
|
||||||
|
|
||||||
const LineChart = Chart.Line;
|
const LineChart = Chart.Line;
|
||||||
|
|
||||||
export default class SensorInfo extends React.Component {
|
export default class SensorInfo extends React.Component {
|
||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
let location = this.props.params.location;
|
let location = this.props.params.location;
|
||||||
this.props.sensorActions.fetchUniqueDates(location);
|
this.props.sensorActions.fetchUniqueDates(location);
|
||||||
@@ -74,7 +69,7 @@ export default class SensorInfo extends React.Component {
|
|||||||
temp.datasets[0].data.push(d.maxtemp);
|
temp.datasets[0].data.push(d.maxtemp);
|
||||||
temp.datasets[1].data.push(d.mintemp);
|
temp.datasets[1].data.push(d.mintemp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
.SensorInfo{
|
.SensorInfo{
|
||||||
flex: 1;
|
|
||||||
padding-right: 1em;
|
padding-right: 1em;
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
min-width: 0;
|
|
||||||
.selector-row{
|
.selector-row{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
select{
|
select{
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
export const ChartOptions = {
|
export const ChartOptions = {
|
||||||
responsive: true,
|
responsive: true,
|
||||||
// scaleOverride: true,
|
scaleOverride: true,
|
||||||
//scaleSteps: 20,
|
scaleStartValue: -10,
|
||||||
// scaleStartValue: 0,
|
scaleSteps: 11,
|
||||||
//scaleStepWidth: 5
|
scaleStepWidth: 10,
|
||||||
};
|
};
|
||||||
|
|
||||||
export let DataTemplate = {
|
export let DataTemplate = {
|
||||||
|
|||||||
189
stats.html
Normal file
189
stats.html
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user