Flot.js
6.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import React, { PureComponent } from 'react';
import {
Row,
Col,
Breadcrumb,
BreadcrumbItem,
} from 'reactstrap';
import $ from 'jquery';
/* eslint-disable */
import 'imports-loader?jQuery=jquery,this=>window!flot';
import 'imports-loader?jQuery=jquery,this=>window!flot/jquery.flot.time';
import 'imports-loader?jQuery=jquery,this=>window!flot/jquery.flot.resize';
import 'imports-loader?jQuery=jquery,this=>window!jquery.flot.animator/jquery.flot.animator';
import 'imports-loader?jQuery=jquery,this=>window!flot/jquery.flot.crosshair';
import 'imports-loader?jQuery=jquery,this=>window!flot/jquery.flot.symbol';
import 'imports-loader?jQuery=jquery,this=>window!flot/jquery.flot.selection';
import 'imports-loader?jQuery=jquery,this=>window!flot/jquery.flot.pie';
import 'imports-loader?jQuery=jquery,this=>window!jquery.flot-orderBars/js/jquery.flot.orderBars';
import 'imports-loader?jQuery=jquery,this=>window!jquery-sparkline';
/* eslint-enable */
import Widget from '../../../components/Widget';
import LineChart from './charts/LineChart';
import TrackingChart from './charts/TrackingChart';
import MarkersChart from './charts/MarkersChart';
import BarsChart from './charts/BarsChart';
import PieChart from './charts/PieChart';
import DonutChart from './charts/DonutChart';
import StackedBar from './charts/BarsStackedCharts';
class EasyPie extends PureComponent {
constructor(props) {
super(props);
this.sparklines = [];
}
componentDidMount() {
this.initSparklines();
}
initSparklines() {
this.sparklines.forEach((spark) => {
$(spark).sparkline('html', $(spark).data());
});
}
render() {
return (
<div>
<Breadcrumb>
<BreadcrumbItem>YOU ARE HERE</BreadcrumbItem>
<BreadcrumbItem>Charts</BreadcrumbItem>
<BreadcrumbItem active>Flot</BreadcrumbItem>
</Breadcrumb>
<h1 className="page-title">Visual - <span className="fw-semi-bold">Flot Charts</span></h1>
<Row>
<Col xs={12} lg={6} xl={5}>
<Widget
title={<h5>Flot <span className="fw-semi-bold">Stacked Line Chart</span></h5>}
close collapse
>
<LineChart />
<p className="fs-mini text-muted">
Flot is a <span className="fw-semi-bold">pure</span> JavaScript plotting library for jQuery,
with a
focus on simple usage, attractive looks and interactive features.
</p>
<h5 className="mt">Interactive <span className="fw-semi-bold">Sparklines</span></h5>
<Row className="mt">
<Col xs={12} md={6}>
<div className="stats-row">
<div className="stat-item">
<p className="value5 fw-thin">34 567</p>
<h6 className="name text-muted no-margin fs-mini">Overall Values</h6>
</div>
<div className="stat-item stat-item-mini-chart">
<div className="sparkline" ref={(r) => { this.sparklines.push(r); }} data-type="bar" data-bar-color="#FFC247" data-height="30" data-bar-width="6" data-bar-spacing="2">
9,12,14,15,10,14,20
</div>
</div>
</div>
</Col>
<Col xs={12} md={6}>
<div className="stats-row">
<div className="stat-item">
<p className="value5 fw-thin">34 567</p>
<h6 className="name text-muted no-margin fs-mini">Overall Values</h6>
</div>
<div className="stat-item stat-item-mini-chart">
<div className="sparkline" ref={(r) => { this.sparklines.push(r); }} data-type="bar" data-bar-color="#FFF8E3" data-height="30" data-bar-width="6" data-bar-spacing="2">
9,12,14,15,10,14,20
</div>
</div>
</div>
</Col>
</Row>
<p className="fs-mini text-muted">
This jQuery plugin generates sparklines (small inline charts) directly in the browser using
data supplied either inline in the HTML, or via javascript.
</p>
</Widget>
</Col>
<Col xs={12} lg={6} xl={7}>
<Widget
title={<h5>Flot <span className="fw-semi-bold">Tracking</span></h5>}
close collapse
>
<div className="mt mb">
<TrackingChart />
</div>
<p className="fs-mini text-muted">
Flot charts can be customized easily due to its <span className="fw-semi-bold">powerful API</span>.
But if you meet any troubles, you are always welcome to contact us to integrate the business
logic into <span className="fw-semi-bold">SING Admin Dashboard</span>.
</p>
</Widget>
</Col>
<Col xs={12}>
<Widget
title={<h5>Flot <span className="fw-semi-bold">Markers</span></h5>}
close collapse
>
<div className="mt mb">
<MarkersChart />
</div>
<p className="fs-mini text-muted">Points can be marked in several ways, with circles being the built-in default.</p>
</Widget>
</Col>
<Col xs={12} lg={7}>
<Widget
title={<h5>Flot <span className="fw-semi-bold">Bars</span></h5>}
close collapse
>
<div className="mt mb">
<BarsChart />
</div>
<p className="fs-mini text-muted">Flot is a pure JavaScript plotting library for jQuery, with a focus on simple usage, attractive looks and interactive features.</p>
</Widget>
</Col>
<Col xs={12} lg={5}>
<Widget
className="mb-xlg"
title={<h5>Flot <span className="fw-semi-bold">Pie Chart</span></h5>}
close collapse
>
<div className="mt mb">
<PieChart />
</div>
<p className="fs-mini text-muted">Labels can be hidden if the slice is less than a given percentage of the pie (19% in this case).</p>
</Widget>
<Widget
className="mb-xlg"
title={<h5>Flot <span className="fw-semi-bold">Donut Chart</span></h5>}
close collapse
>
<DonutChart />
</Widget>
</Col>
<Col xs={12}>
<Widget
className="mb-xlg"
title={<h5>Flot <span className="fw-semi-bold">Bars Stacked</span></h5>}
close collapse
>
<div className="mt mb">
<StackedBar />
</div>
</Widget>
</Col>
</Row>
</div>
);
}
}
export default EasyPie;