first commit
This commit is contained in:
BIN
assets/plugin/chart/._chartist
Executable file
BIN
assets/plugin/chart/._chartist
Executable file
Binary file not shown.
BIN
assets/plugin/chart/._chartjs
Executable file
BIN
assets/plugin/chart/._chartjs
Executable file
Binary file not shown.
BIN
assets/plugin/chart/._highcharts
Executable file
BIN
assets/plugin/chart/._highcharts
Executable file
Binary file not shown.
BIN
assets/plugin/chart/._morris
Executable file
BIN
assets/plugin/chart/._morris
Executable file
Binary file not shown.
BIN
assets/plugin/chart/._plot
Executable file
BIN
assets/plugin/chart/._plot
Executable file
Binary file not shown.
BIN
assets/plugin/chart/._sparkline
Executable file
BIN
assets/plugin/chart/._sparkline
Executable file
Binary file not shown.
BIN
assets/plugin/chart/chartist/._chartist.css
Executable file
BIN
assets/plugin/chart/chartist/._chartist.css
Executable file
Binary file not shown.
BIN
assets/plugin/chart/chartist/._chartist.css.map
Executable file
BIN
assets/plugin/chart/chartist/._chartist.css.map
Executable file
Binary file not shown.
BIN
assets/plugin/chart/chartist/._chartist.js
Executable file
BIN
assets/plugin/chart/chartist/._chartist.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/chartist/._chartist.min.css
vendored
Executable file
BIN
assets/plugin/chart/chartist/._chartist.min.css
vendored
Executable file
Binary file not shown.
BIN
assets/plugin/chart/chartist/._chartist.min.js
vendored
Executable file
BIN
assets/plugin/chart/chartist/._chartist.min.js
vendored
Executable file
Binary file not shown.
BIN
assets/plugin/chart/chartist/._chartist.min.js.map
Executable file
BIN
assets/plugin/chart/chartist/._chartist.min.js.map
Executable file
Binary file not shown.
BIN
assets/plugin/chart/chartist/._scss
Executable file
BIN
assets/plugin/chart/chartist/._scss
Executable file
Binary file not shown.
608
assets/plugin/chart/chartist/chartist.css
Executable file
608
assets/plugin/chart/chartist/chartist.css
Executable file
@ -0,0 +1,608 @@
|
||||
.ct-label {
|
||||
fill: rgba(0, 0, 0, 0.4);
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
font-size: 0.75rem;
|
||||
line-height: 1; }
|
||||
|
||||
.ct-chart-line .ct-label,
|
||||
.ct-chart-bar .ct-label {
|
||||
display: block;
|
||||
display: -webkit-box;
|
||||
display: -moz-box;
|
||||
display: -ms-flexbox;
|
||||
display: -webkit-flex;
|
||||
display: flex; }
|
||||
|
||||
.ct-label.ct-horizontal.ct-start {
|
||||
-webkit-box-align: flex-end;
|
||||
-webkit-align-items: flex-end;
|
||||
-ms-flex-align: flex-end;
|
||||
align-items: flex-end;
|
||||
-webkit-box-pack: flex-start;
|
||||
-webkit-justify-content: flex-start;
|
||||
-ms-flex-pack: flex-start;
|
||||
justify-content: flex-start;
|
||||
text-align: left;
|
||||
text-anchor: start; }
|
||||
|
||||
.ct-label.ct-horizontal.ct-end {
|
||||
-webkit-box-align: flex-start;
|
||||
-webkit-align-items: flex-start;
|
||||
-ms-flex-align: flex-start;
|
||||
align-items: flex-start;
|
||||
-webkit-box-pack: flex-start;
|
||||
-webkit-justify-content: flex-start;
|
||||
-ms-flex-pack: flex-start;
|
||||
justify-content: flex-start;
|
||||
text-align: left;
|
||||
text-anchor: start; }
|
||||
|
||||
.ct-label.ct-vertical.ct-start {
|
||||
-webkit-box-align: flex-end;
|
||||
-webkit-align-items: flex-end;
|
||||
-ms-flex-align: flex-end;
|
||||
align-items: flex-end;
|
||||
-webkit-box-pack: flex-end;
|
||||
-webkit-justify-content: flex-end;
|
||||
-ms-flex-pack: flex-end;
|
||||
justify-content: flex-end;
|
||||
text-align: right;
|
||||
text-anchor: end; }
|
||||
|
||||
.ct-label.ct-vertical.ct-end {
|
||||
-webkit-box-align: flex-end;
|
||||
-webkit-align-items: flex-end;
|
||||
-ms-flex-align: flex-end;
|
||||
align-items: flex-end;
|
||||
-webkit-box-pack: flex-start;
|
||||
-webkit-justify-content: flex-start;
|
||||
-ms-flex-pack: flex-start;
|
||||
justify-content: flex-start;
|
||||
text-align: left;
|
||||
text-anchor: start; }
|
||||
|
||||
.ct-chart-bar .ct-label.ct-horizontal.ct-start {
|
||||
-webkit-box-align: flex-end;
|
||||
-webkit-align-items: flex-end;
|
||||
-ms-flex-align: flex-end;
|
||||
align-items: flex-end;
|
||||
-webkit-box-pack: center;
|
||||
-webkit-justify-content: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
text-anchor: start; }
|
||||
|
||||
.ct-chart-bar .ct-label.ct-horizontal.ct-end {
|
||||
-webkit-box-align: flex-start;
|
||||
-webkit-align-items: flex-start;
|
||||
-ms-flex-align: flex-start;
|
||||
align-items: flex-start;
|
||||
-webkit-box-pack: center;
|
||||
-webkit-justify-content: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
text-anchor: start; }
|
||||
|
||||
.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start {
|
||||
-webkit-box-align: flex-end;
|
||||
-webkit-align-items: flex-end;
|
||||
-ms-flex-align: flex-end;
|
||||
align-items: flex-end;
|
||||
-webkit-box-pack: flex-start;
|
||||
-webkit-justify-content: flex-start;
|
||||
-ms-flex-pack: flex-start;
|
||||
justify-content: flex-start;
|
||||
text-align: left;
|
||||
text-anchor: start; }
|
||||
|
||||
.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end {
|
||||
-webkit-box-align: flex-start;
|
||||
-webkit-align-items: flex-start;
|
||||
-ms-flex-align: flex-start;
|
||||
align-items: flex-start;
|
||||
-webkit-box-pack: flex-start;
|
||||
-webkit-justify-content: flex-start;
|
||||
-ms-flex-pack: flex-start;
|
||||
justify-content: flex-start;
|
||||
text-align: left;
|
||||
text-anchor: start; }
|
||||
|
||||
.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start {
|
||||
-webkit-box-align: center;
|
||||
-webkit-align-items: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-pack: flex-end;
|
||||
-webkit-justify-content: flex-end;
|
||||
-ms-flex-pack: flex-end;
|
||||
justify-content: flex-end;
|
||||
text-align: right;
|
||||
text-anchor: end; }
|
||||
|
||||
.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end {
|
||||
-webkit-box-align: center;
|
||||
-webkit-align-items: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-pack: flex-start;
|
||||
-webkit-justify-content: flex-start;
|
||||
-ms-flex-pack: flex-start;
|
||||
justify-content: flex-start;
|
||||
text-align: left;
|
||||
text-anchor: end; }
|
||||
|
||||
.ct-grid {
|
||||
stroke: rgba(0, 0, 0, 0.2);
|
||||
stroke-width: 1px;
|
||||
stroke-dasharray: 2px; }
|
||||
|
||||
.ct-point {
|
||||
stroke-width: 10px;
|
||||
stroke-linecap: round; }
|
||||
|
||||
.ct-line {
|
||||
fill: none;
|
||||
stroke-width: 4px; }
|
||||
|
||||
.ct-area {
|
||||
stroke: none;
|
||||
fill-opacity: 0.1; }
|
||||
|
||||
.ct-bar {
|
||||
fill: none;
|
||||
stroke-width: 10px; }
|
||||
|
||||
.ct-slice-donut {
|
||||
fill: none;
|
||||
stroke-width: 60px; }
|
||||
|
||||
.ct-series-a .ct-point, .ct-series-a .ct-line, .ct-series-a .ct-bar, .ct-series-a .ct-slice-donut {
|
||||
stroke: #d70206; }
|
||||
|
||||
.ct-series-a .ct-slice-pie, .ct-series-a .ct-area {
|
||||
fill: #d70206; }
|
||||
|
||||
.ct-series-b .ct-point, .ct-series-b .ct-line, .ct-series-b .ct-bar, .ct-series-b .ct-slice-donut {
|
||||
stroke: #f05b4f; }
|
||||
|
||||
.ct-series-b .ct-slice-pie, .ct-series-b .ct-area {
|
||||
fill: #f05b4f; }
|
||||
|
||||
.ct-series-c .ct-point, .ct-series-c .ct-line, .ct-series-c .ct-bar, .ct-series-c .ct-slice-donut {
|
||||
stroke: #f4c63d; }
|
||||
|
||||
.ct-series-c .ct-slice-pie, .ct-series-c .ct-area {
|
||||
fill: #f4c63d; }
|
||||
|
||||
.ct-series-d .ct-point, .ct-series-d .ct-line, .ct-series-d .ct-bar, .ct-series-d .ct-slice-donut {
|
||||
stroke: #d17905; }
|
||||
|
||||
.ct-series-d .ct-slice-pie, .ct-series-d .ct-area {
|
||||
fill: #d17905; }
|
||||
|
||||
.ct-series-e .ct-point, .ct-series-e .ct-line, .ct-series-e .ct-bar, .ct-series-e .ct-slice-donut {
|
||||
stroke: #453d3f; }
|
||||
|
||||
.ct-series-e .ct-slice-pie, .ct-series-e .ct-area {
|
||||
fill: #453d3f; }
|
||||
|
||||
.ct-series-f .ct-point, .ct-series-f .ct-line, .ct-series-f .ct-bar, .ct-series-f .ct-slice-donut {
|
||||
stroke: #59922b; }
|
||||
|
||||
.ct-series-f .ct-slice-pie, .ct-series-f .ct-area {
|
||||
fill: #59922b; }
|
||||
|
||||
.ct-series-g .ct-point, .ct-series-g .ct-line, .ct-series-g .ct-bar, .ct-series-g .ct-slice-donut {
|
||||
stroke: #0544d3; }
|
||||
|
||||
.ct-series-g .ct-slice-pie, .ct-series-g .ct-area {
|
||||
fill: #0544d3; }
|
||||
|
||||
.ct-series-h .ct-point, .ct-series-h .ct-line, .ct-series-h .ct-bar, .ct-series-h .ct-slice-donut {
|
||||
stroke: #6b0392; }
|
||||
|
||||
.ct-series-h .ct-slice-pie, .ct-series-h .ct-area {
|
||||
fill: #6b0392; }
|
||||
|
||||
.ct-series-i .ct-point, .ct-series-i .ct-line, .ct-series-i .ct-bar, .ct-series-i .ct-slice-donut {
|
||||
stroke: #f05b4f; }
|
||||
|
||||
.ct-series-i .ct-slice-pie, .ct-series-i .ct-area {
|
||||
fill: #f05b4f; }
|
||||
|
||||
.ct-series-j .ct-point, .ct-series-j .ct-line, .ct-series-j .ct-bar, .ct-series-j .ct-slice-donut {
|
||||
stroke: #dda458; }
|
||||
|
||||
.ct-series-j .ct-slice-pie, .ct-series-j .ct-area {
|
||||
fill: #dda458; }
|
||||
|
||||
.ct-series-k .ct-point, .ct-series-k .ct-line, .ct-series-k .ct-bar, .ct-series-k .ct-slice-donut {
|
||||
stroke: #eacf7d; }
|
||||
|
||||
.ct-series-k .ct-slice-pie, .ct-series-k .ct-area {
|
||||
fill: #eacf7d; }
|
||||
|
||||
.ct-series-l .ct-point, .ct-series-l .ct-line, .ct-series-l .ct-bar, .ct-series-l .ct-slice-donut {
|
||||
stroke: #86797d; }
|
||||
|
||||
.ct-series-l .ct-slice-pie, .ct-series-l .ct-area {
|
||||
fill: #86797d; }
|
||||
|
||||
.ct-series-m .ct-point, .ct-series-m .ct-line, .ct-series-m .ct-bar, .ct-series-m .ct-slice-donut {
|
||||
stroke: #b2c326; }
|
||||
|
||||
.ct-series-m .ct-slice-pie, .ct-series-m .ct-area {
|
||||
fill: #b2c326; }
|
||||
|
||||
.ct-series-n .ct-point, .ct-series-n .ct-line, .ct-series-n .ct-bar, .ct-series-n .ct-slice-donut {
|
||||
stroke: #6188e2; }
|
||||
|
||||
.ct-series-n .ct-slice-pie, .ct-series-n .ct-area {
|
||||
fill: #6188e2; }
|
||||
|
||||
.ct-series-o .ct-point, .ct-series-o .ct-line, .ct-series-o .ct-bar, .ct-series-o .ct-slice-donut {
|
||||
stroke: #a748ca; }
|
||||
|
||||
.ct-series-o .ct-slice-pie, .ct-series-o .ct-area {
|
||||
fill: #a748ca; }
|
||||
|
||||
.ct-square {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-square:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 100%; }
|
||||
.ct-square:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-square > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-minor-second {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-minor-second:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 93.75%; }
|
||||
.ct-minor-second:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-minor-second > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-major-second {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-major-second:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 88.8888888889%; }
|
||||
.ct-major-second:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-major-second > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-minor-third {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-minor-third:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 83.3333333333%; }
|
||||
.ct-minor-third:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-minor-third > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-major-third {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-major-third:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 80%; }
|
||||
.ct-major-third:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-major-third > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-perfect-fourth {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-perfect-fourth:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 75%; }
|
||||
.ct-perfect-fourth:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-perfect-fourth > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-perfect-fifth {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-perfect-fifth:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 66.6666666667%; }
|
||||
.ct-perfect-fifth:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-perfect-fifth > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-minor-sixth {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-minor-sixth:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 62.5%; }
|
||||
.ct-minor-sixth:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-minor-sixth > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-golden-section {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-golden-section:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 61.804697157%; }
|
||||
.ct-golden-section:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-golden-section > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-major-sixth {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-major-sixth:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 60%; }
|
||||
.ct-major-sixth:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-major-sixth > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-minor-seventh {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-minor-seventh:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 56.25%; }
|
||||
.ct-minor-seventh:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-minor-seventh > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-major-seventh {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-major-seventh:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 53.3333333333%; }
|
||||
.ct-major-seventh:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-major-seventh > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-octave {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-octave:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 50%; }
|
||||
.ct-octave:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-octave > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-major-tenth {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-major-tenth:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 40%; }
|
||||
.ct-major-tenth:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-major-tenth > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-major-eleventh {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-major-eleventh:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 37.5%; }
|
||||
.ct-major-eleventh:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-major-eleventh > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-major-twelfth {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-major-twelfth:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 33.3333333333%; }
|
||||
.ct-major-twelfth:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-major-twelfth > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
.ct-double-octave {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%; }
|
||||
.ct-double-octave:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: 25%; }
|
||||
.ct-double-octave:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
.ct-double-octave > svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0; }
|
||||
|
||||
/*# sourceMappingURL=chartist.css.map */
|
10
assets/plugin/chart/chartist/chartist.css.map
Executable file
10
assets/plugin/chart/chartist/chartist.css.map
Executable file
File diff suppressed because one or more lines are too long
4328
assets/plugin/chart/chartist/chartist.js
Executable file
4328
assets/plugin/chart/chartist/chartist.js
Executable file
File diff suppressed because it is too large
Load Diff
1
assets/plugin/chart/chartist/chartist.min.css
vendored
Executable file
1
assets/plugin/chart/chartist/chartist.min.css
vendored
Executable file
File diff suppressed because one or more lines are too long
10
assets/plugin/chart/chartist/chartist.min.js
vendored
Executable file
10
assets/plugin/chart/chartist/chartist.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
1
assets/plugin/chart/chartist/chartist.min.js.map
Executable file
1
assets/plugin/chart/chartist/chartist.min.js.map
Executable file
File diff suppressed because one or more lines are too long
BIN
assets/plugin/chart/chartist/scss/._chartist.scss
Executable file
BIN
assets/plugin/chart/chartist/scss/._chartist.scss
Executable file
Binary file not shown.
BIN
assets/plugin/chart/chartist/scss/._settings
Executable file
BIN
assets/plugin/chart/chartist/scss/._settings
Executable file
Binary file not shown.
232
assets/plugin/chart/chartist/scss/chartist.scss
Executable file
232
assets/plugin/chart/chartist/scss/chartist.scss
Executable file
@ -0,0 +1,232 @@
|
||||
@import "settings/chartist-settings";
|
||||
|
||||
@mixin ct-responsive-svg-container($width: 100%, $ratio: $ct-container-ratio) {
|
||||
display: block;
|
||||
position: relative;
|
||||
width: $width;
|
||||
|
||||
&:before {
|
||||
display: block;
|
||||
float: left;
|
||||
content: "";
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding-bottom: $ratio * 100%;
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
> svg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin ct-align-justify($ct-text-align: $ct-text-align, $ct-text-justify: $ct-text-justify) {
|
||||
-webkit-box-align: $ct-text-align;
|
||||
-webkit-align-items: $ct-text-align;
|
||||
-ms-flex-align: $ct-text-align;
|
||||
align-items: $ct-text-align;
|
||||
-webkit-box-pack: $ct-text-justify;
|
||||
-webkit-justify-content: $ct-text-justify;
|
||||
-ms-flex-pack: $ct-text-justify;
|
||||
justify-content: $ct-text-justify;
|
||||
// Fallback to text-align for non-flex browsers
|
||||
@if($ct-text-justify == 'flex-start') {
|
||||
text-align: left;
|
||||
} @else if ($ct-text-justify == 'flex-end') {
|
||||
text-align: right;
|
||||
} @else {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin ct-flex() {
|
||||
// Fallback to block
|
||||
display: block;
|
||||
display: -webkit-box;
|
||||
display: -moz-box;
|
||||
display: -ms-flexbox;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
@mixin ct-chart-label($ct-text-color: $ct-text-color, $ct-text-size: $ct-text-size, $ct-text-line-height: $ct-text-line-height) {
|
||||
fill: $ct-text-color;
|
||||
color: $ct-text-color;
|
||||
font-size: $ct-text-size;
|
||||
line-height: $ct-text-line-height;
|
||||
}
|
||||
|
||||
@mixin ct-chart-grid($ct-grid-color: $ct-grid-color, $ct-grid-width: $ct-grid-width, $ct-grid-dasharray: $ct-grid-dasharray) {
|
||||
stroke: $ct-grid-color;
|
||||
stroke-width: $ct-grid-width;
|
||||
|
||||
@if ($ct-grid-dasharray) {
|
||||
stroke-dasharray: $ct-grid-dasharray;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin ct-chart-point($ct-point-size: $ct-point-size, $ct-point-shape: $ct-point-shape) {
|
||||
stroke-width: $ct-point-size;
|
||||
stroke-linecap: $ct-point-shape;
|
||||
}
|
||||
|
||||
@mixin ct-chart-line($ct-line-width: $ct-line-width, $ct-line-dasharray: $ct-line-dasharray) {
|
||||
fill: none;
|
||||
stroke-width: $ct-line-width;
|
||||
|
||||
@if ($ct-line-dasharray) {
|
||||
stroke-dasharray: $ct-line-dasharray;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin ct-chart-area($ct-area-opacity: $ct-area-opacity) {
|
||||
stroke: none;
|
||||
fill-opacity: $ct-area-opacity;
|
||||
}
|
||||
|
||||
@mixin ct-chart-bar($ct-bar-width: $ct-bar-width) {
|
||||
fill: none;
|
||||
stroke-width: $ct-bar-width;
|
||||
}
|
||||
|
||||
@mixin ct-chart-donut($ct-donut-width: $ct-donut-width) {
|
||||
fill: none;
|
||||
stroke-width: $ct-donut-width;
|
||||
}
|
||||
|
||||
@mixin ct-chart-series-color($color) {
|
||||
.#{$ct-class-point}, .#{$ct-class-line}, .#{$ct-class-bar}, .#{$ct-class-slice-donut} {
|
||||
stroke: $color;
|
||||
}
|
||||
|
||||
.#{$ct-class-slice-pie}, .#{$ct-class-area} {
|
||||
fill: $color;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin ct-chart($ct-container-ratio: $ct-container-ratio, $ct-text-color: $ct-text-color, $ct-text-size: $ct-text-size, $ct-grid-color: $ct-grid-color, $ct-grid-width: $ct-grid-width, $ct-grid-dasharray: $ct-grid-dasharray, $ct-point-size: $ct-point-size, $ct-point-shape: $ct-point-shape, $ct-line-width: $ct-line-width, $ct-bar-width: $ct-bar-width, $ct-donut-width: $ct-donut-width, $ct-series-names: $ct-series-names, $ct-series-colors: $ct-series-colors) {
|
||||
|
||||
.#{$ct-class-label} {
|
||||
@include ct-chart-label($ct-text-color, $ct-text-size);
|
||||
}
|
||||
|
||||
.#{$ct-class-chart-line} .#{$ct-class-label},
|
||||
.#{$ct-class-chart-bar} .#{$ct-class-label} {
|
||||
@include ct-flex();
|
||||
}
|
||||
|
||||
.#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-start} {
|
||||
@include ct-align-justify(flex-end, flex-start);
|
||||
// Fallback for browsers that don't support foreignObjects
|
||||
text-anchor: start;
|
||||
}
|
||||
|
||||
.#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-end} {
|
||||
@include ct-align-justify(flex-start, flex-start);
|
||||
// Fallback for browsers that don't support foreignObjects
|
||||
text-anchor: start;
|
||||
}
|
||||
|
||||
.#{$ct-class-label}.#{$ct-class-vertical}.#{$ct-class-start} {
|
||||
@include ct-align-justify(flex-end, flex-end);
|
||||
// Fallback for browsers that don't support foreignObjects
|
||||
text-anchor: end;
|
||||
}
|
||||
|
||||
.#{$ct-class-label}.#{$ct-class-vertical}.#{$ct-class-end} {
|
||||
@include ct-align-justify(flex-end, flex-start);
|
||||
// Fallback for browsers that don't support foreignObjects
|
||||
text-anchor: start;
|
||||
}
|
||||
|
||||
.#{$ct-class-chart-bar} .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-start} {
|
||||
@include ct-align-justify(flex-end, center);
|
||||
// Fallback for browsers that don't support foreignObjects
|
||||
text-anchor: start;
|
||||
}
|
||||
|
||||
.#{$ct-class-chart-bar} .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-end} {
|
||||
@include ct-align-justify(flex-start, center);
|
||||
// Fallback for browsers that don't support foreignObjects
|
||||
text-anchor: start;
|
||||
}
|
||||
|
||||
.#{$ct-class-chart-bar}.#{$ct-class-horizontal-bars} .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-start} {
|
||||
@include ct-align-justify(flex-end, flex-start);
|
||||
// Fallback for browsers that don't support foreignObjects
|
||||
text-anchor: start;
|
||||
}
|
||||
|
||||
.#{$ct-class-chart-bar}.#{$ct-class-horizontal-bars} .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-end} {
|
||||
@include ct-align-justify(flex-start, flex-start);
|
||||
// Fallback for browsers that don't support foreignObjects
|
||||
text-anchor: start;
|
||||
}
|
||||
|
||||
.#{$ct-class-chart-bar}.#{$ct-class-horizontal-bars} .#{$ct-class-label}.#{$ct-class-vertical}.#{$ct-class-start} {
|
||||
//@include ct-chart-label($ct-text-color, $ct-text-size, center, $ct-vertical-text-justify);
|
||||
@include ct-align-justify(center, flex-end);
|
||||
// Fallback for browsers that don't support foreignObjects
|
||||
text-anchor: end;
|
||||
}
|
||||
|
||||
.#{$ct-class-chart-bar}.#{$ct-class-horizontal-bars} .#{$ct-class-label}.#{$ct-class-vertical}.#{$ct-class-end} {
|
||||
@include ct-align-justify(center, flex-start);
|
||||
// Fallback for browsers that don't support foreignObjects
|
||||
text-anchor: end;
|
||||
}
|
||||
|
||||
.#{$ct-class-grid} {
|
||||
@include ct-chart-grid($ct-grid-color, $ct-grid-width, $ct-grid-dasharray);
|
||||
}
|
||||
|
||||
.#{$ct-class-point} {
|
||||
@include ct-chart-point($ct-point-size, $ct-point-shape);
|
||||
}
|
||||
|
||||
.#{$ct-class-line} {
|
||||
@include ct-chart-line($ct-line-width);
|
||||
}
|
||||
|
||||
.#{$ct-class-area} {
|
||||
@include ct-chart-area();
|
||||
}
|
||||
|
||||
.#{$ct-class-bar} {
|
||||
@include ct-chart-bar($ct-bar-width);
|
||||
}
|
||||
|
||||
.#{$ct-class-slice-donut} {
|
||||
@include ct-chart-donut($ct-donut-width);
|
||||
}
|
||||
|
||||
@if $ct-include-colored-series {
|
||||
@for $i from 0 to length($ct-series-names) {
|
||||
.#{$ct-class-series}-#{nth($ct-series-names, $i + 1)} {
|
||||
$color: nth($ct-series-colors, $i + 1);
|
||||
|
||||
@include ct-chart-series-color($color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if $ct-include-classes {
|
||||
@include ct-chart();
|
||||
|
||||
@if $ct-include-alternative-responsive-containers {
|
||||
@for $i from 0 to length($ct-scales-names) {
|
||||
.#{nth($ct-scales-names, $i + 1)} {
|
||||
@include ct-responsive-svg-container($ratio: nth($ct-scales, $i + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
BIN
assets/plugin/chart/chartist/scss/settings/.__chartist-settings.scss
Executable file
BIN
assets/plugin/chart/chartist/scss/settings/.__chartist-settings.scss
Executable file
Binary file not shown.
85
assets/plugin/chart/chartist/scss/settings/_chartist-settings.scss
Executable file
85
assets/plugin/chart/chartist/scss/settings/_chartist-settings.scss
Executable file
@ -0,0 +1,85 @@
|
||||
// Scales for responsive SVG containers
|
||||
$ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
|
||||
$ct-scales-names: (ct-square, ct-minor-second, ct-major-second, ct-minor-third, ct-major-third, ct-perfect-fourth, ct-perfect-fifth, ct-minor-sixth, ct-golden-section, ct-major-sixth, ct-minor-seventh, ct-major-seventh, ct-octave, ct-major-tenth, ct-major-eleventh, ct-major-twelfth, ct-double-octave) !default;
|
||||
|
||||
// Class names to be used when generating CSS
|
||||
$ct-class-chart: ct-chart !default;
|
||||
$ct-class-chart-line: ct-chart-line !default;
|
||||
$ct-class-chart-bar: ct-chart-bar !default;
|
||||
$ct-class-horizontal-bars: ct-horizontal-bars !default;
|
||||
$ct-class-chart-pie: ct-chart-pie !default;
|
||||
$ct-class-chart-donut: ct-chart-donut !default;
|
||||
$ct-class-label: ct-label !default;
|
||||
$ct-class-series: ct-series !default;
|
||||
$ct-class-line: ct-line !default;
|
||||
$ct-class-point: ct-point !default;
|
||||
$ct-class-area: ct-area !default;
|
||||
$ct-class-bar: ct-bar !default;
|
||||
$ct-class-slice-pie: ct-slice-pie !default;
|
||||
$ct-class-slice-donut: ct-slice-donut !default;
|
||||
$ct-class-grid: ct-grid !default;
|
||||
$ct-class-vertical: ct-vertical !default;
|
||||
$ct-class-horizontal: ct-horizontal !default;
|
||||
$ct-class-start: ct-start !default;
|
||||
$ct-class-end: ct-end !default;
|
||||
|
||||
// Container ratio
|
||||
$ct-container-ratio: (1/1.618) !default;
|
||||
|
||||
// Text styles for labels
|
||||
$ct-text-color: rgba(0, 0, 0, 0.4) !default;
|
||||
$ct-text-size: 0.75rem !default;
|
||||
$ct-text-align: flex-start !default;
|
||||
$ct-text-justify: flex-start !default;
|
||||
$ct-text-line-height: 1;
|
||||
|
||||
// Grid styles
|
||||
$ct-grid-color: rgba(0, 0, 0, 0.2) !default;
|
||||
$ct-grid-dasharray: 2px !default;
|
||||
$ct-grid-width: 1px !default;
|
||||
|
||||
// Line chart properties
|
||||
$ct-line-width: 4px !default;
|
||||
$ct-line-dasharray: false !default;
|
||||
$ct-point-size: 10px !default;
|
||||
// Line chart point, can be either round or square
|
||||
$ct-point-shape: round !default;
|
||||
// Area fill transparency between 0 and 1
|
||||
$ct-area-opacity: 0.1 !default;
|
||||
|
||||
// Bar chart bar width
|
||||
$ct-bar-width: 10px !default;
|
||||
|
||||
// Donut width (If donut width is to big it can cause issues where the shape gets distorted)
|
||||
$ct-donut-width: 60px !default;
|
||||
|
||||
// If set to true it will include the default classes and generate CSS output. If you're planning to use the mixins you
|
||||
// should set this property to false
|
||||
$ct-include-classes: true !default;
|
||||
|
||||
// If this is set to true the CSS will contain colored series. You can extend or change the color with the
|
||||
// properties below
|
||||
$ct-include-colored-series: $ct-include-classes !default;
|
||||
|
||||
// If set to true this will include all responsive container variations using the scales defined at the top of the script
|
||||
$ct-include-alternative-responsive-containers: $ct-include-classes !default;
|
||||
|
||||
// Series names and colors. This can be extended or customized as desired. Just add more series and colors.
|
||||
$ct-series-names: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) !default;
|
||||
$ct-series-colors: (
|
||||
#d70206,
|
||||
#f05b4f,
|
||||
#f4c63d,
|
||||
#d17905,
|
||||
#453d3f,
|
||||
#59922b,
|
||||
#0544d3,
|
||||
#6b0392,
|
||||
#f05b4f,
|
||||
#dda458,
|
||||
#eacf7d,
|
||||
#86797d,
|
||||
#b2c326,
|
||||
#6188e2,
|
||||
#a748ca
|
||||
) !default;
|
BIN
assets/plugin/chart/chartjs/._Chart.bundle.js
Executable file
BIN
assets/plugin/chart/chartjs/._Chart.bundle.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/chartjs/._Chart.bundle.min.js
vendored
Executable file
BIN
assets/plugin/chart/chartjs/._Chart.bundle.min.js
vendored
Executable file
Binary file not shown.
BIN
assets/plugin/chart/chartjs/._Chart.js
Executable file
BIN
assets/plugin/chart/chartjs/._Chart.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/chartjs/._Chart.min.js
vendored
Executable file
BIN
assets/plugin/chart/chartjs/._Chart.min.js
vendored
Executable file
Binary file not shown.
14719
assets/plugin/chart/chartjs/Chart.bundle.js
Executable file
14719
assets/plugin/chart/chartjs/Chart.bundle.js
Executable file
File diff suppressed because it is too large
Load Diff
15
assets/plugin/chart/chartjs/Chart.bundle.min.js
vendored
Executable file
15
assets/plugin/chart/chartjs/Chart.bundle.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
10525
assets/plugin/chart/chartjs/Chart.js
vendored
Executable file
10525
assets/plugin/chart/chartjs/Chart.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
14
assets/plugin/chart/chartjs/Chart.min.js
vendored
Executable file
14
assets/plugin/chart/chartjs/Chart.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
BIN
assets/plugin/chart/highcharts/._code
Executable file
BIN
assets/plugin/chart/highcharts/._code
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/._css
Executable file
BIN
assets/plugin/chart/highcharts/._css
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/._highcharts-3d.js
Executable file
BIN
assets/plugin/chart/highcharts/._highcharts-3d.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/._highcharts-3d.src.js
Executable file
BIN
assets/plugin/chart/highcharts/._highcharts-3d.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/._highcharts-more.js
Executable file
BIN
assets/plugin/chart/highcharts/._highcharts-more.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/._highcharts-more.src.js
Executable file
BIN
assets/plugin/chart/highcharts/._highcharts-more.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/._highcharts.js
Executable file
BIN
assets/plugin/chart/highcharts/._highcharts.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/._highcharts.src.js
Executable file
BIN
assets/plugin/chart/highcharts/._highcharts.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/._js
Executable file
BIN
assets/plugin/chart/highcharts/._js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/._lib
Executable file
BIN
assets/plugin/chart/highcharts/._lib
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/._modules
Executable file
BIN
assets/plugin/chart/highcharts/._modules
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/._readme.txt
Executable file
BIN
assets/plugin/chart/highcharts/._readme.txt
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/._themes
Executable file
BIN
assets/plugin/chart/highcharts/._themes
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/._js
Executable file
BIN
assets/plugin/chart/highcharts/code/._js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/._modules
Executable file
BIN
assets/plugin/chart/highcharts/code/js/._modules
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._accessibility.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._accessibility.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._accessibility.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._accessibility.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._annotations.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._annotations.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._annotations.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._annotations.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._boost.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._boost.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._boost.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._boost.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._broken-axis.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._broken-axis.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._broken-axis.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._broken-axis.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._data.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._data.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._data.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._data.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._drilldown.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._drilldown.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._drilldown.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._drilldown.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._exporting.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._exporting.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._exporting.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._exporting.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._funnel.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._funnel.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._funnel.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._funnel.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._gantt.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._gantt.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._gantt.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._gantt.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._grid-axis.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._grid-axis.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._grid-axis.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._grid-axis.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._heatmap.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._heatmap.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._heatmap.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._heatmap.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._no-data-to-display.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._no-data-to-display.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._no-data-to-display.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._no-data-to-display.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._offline-exporting.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._offline-exporting.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._offline-exporting.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._offline-exporting.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._overlapping-datalabels.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._overlapping-datalabels.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._overlapping-datalabels.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._overlapping-datalabels.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._series-label.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._series-label.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._series-label.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._series-label.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._solid-gauge.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._solid-gauge.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._solid-gauge.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._solid-gauge.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._treemap.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._treemap.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._treemap.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._treemap.src.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._xrange-series.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._xrange-series.js
Executable file
Binary file not shown.
BIN
assets/plugin/chart/highcharts/code/js/modules/._xrange-series.src.js
Executable file
BIN
assets/plugin/chart/highcharts/code/js/modules/._xrange-series.src.js
Executable file
Binary file not shown.
46
assets/plugin/chart/highcharts/code/js/modules/accessibility.js
Executable file
46
assets/plugin/chart/highcharts/code/js/modules/accessibility.js
Executable file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
Highcharts JS v5.0.2 (2016-10-26)
|
||||
Accessibility module
|
||||
|
||||
(c) 2010-2016 Highsoft AS
|
||||
Author: Oystein Moseng
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(h){"object"===typeof module&&module.exports?module.exports=h:h(Highcharts)})(function(h){(function(e){function h(a){for(var b=a.childNodes.length;b--;)a.appendChild(a.childNodes[b])}function q(a){var b;a&&a.onclick&&(b=l.createEvent("Events"),b.initEvent("click",!0,!1),a.onclick(b))}var y=e.win,l=y.document,g=e.each,A=e.erase,v=e.addEvent,B=e.removeEvent,w=e.fireEvent,C=e.dateFormat,u=e.merge,r={"default":["series","data point","data points"],line:["line","data point","data points"],spline:["line",
|
||||
"data point","data points"],area:["line","data point","data points"],areaspline:["line","data point","data points"],pie:["pie","slice","slices"],column:["column series","column","columns"],bar:["bar series","bar","bars"],scatter:["scatter series","data point","data points"],boxplot:["boxplot series","box","boxes"],arearange:["arearange series","data point","data points"],areasplinerange:["areasplinerange series","data point","data points"],bubble:["bubble series","bubble","bubbles"],columnrange:["columnrange series",
|
||||
"column","columns"],errorbar:["errorbar series","errorbar","errorbars"],funnel:["funnel","data point","data points"],pyramid:["pyramid","data point","data points"],waterfall:["waterfall series","column","columns"],map:["map","area","areas"],mapline:["line","data point","data points"],mappoint:["point series","data point","data points"],mapbubble:["bubble series","bubble","bubbles"]},D={boxplot:" Box plot charts are typically used to display groups of statistical data. Each data point in the chart can have up to 5 values: minimum, lower quartile, median, upper quartile and maximum. ",
|
||||
arearange:" Arearange charts are line charts displaying a range between a lower and higher value for each point. ",areasplinerange:" These charts are line charts displaying a range between a lower and higher value for each point. ",bubble:" Bubble charts are scatter charts where each data point also has a size value. ",columnrange:" Columnrange charts are column charts displaying a range between a lower and higher value for each point. ",errorbar:" Errorbar series are used to display the variability of the data. ",
|
||||
funnel:" Funnel charts are used to display reduction of data in stages. ",pyramid:" Pyramid charts consist of a single pyramid with item heights corresponding to each point value. ",waterfall:" A waterfall chart is a column chart where each column contributes towards a total end value. "},E="name id category x value y".split(" "),z="z open high q3 median q1 low close".split(" ");e.setOptions({accessibility:{enabled:!0,pointDescriptionThreshold:30,keyboardNavigation:{enabled:!0}}});e.wrap(e.Series.prototype,
|
||||
"render",function(a){a.apply(this,Array.prototype.slice.call(arguments,1));this.chart.options.accessibility.enabled&&this.setA11yDescription()});e.Series.prototype.setA11yDescription=function(){var a=this.chart.options.accessibility,b=this.points&&this.points.length&&this.points[0].graphic&&this.points[0].graphic.element,d=b&&b.parentNode||this.graph&&this.graph.element||this.group&&this.group.element;d&&(d.lastChild===b&&h(d),this.points&&(this.points.length<a.pointDescriptionThreshold||!1===a.pointDescriptionThreshold)&&
|
||||
g(this.points,function(c){c.graphic&&(c.graphic.element.setAttribute("role","img"),c.graphic.element.setAttribute("tabindex","-1"),c.graphic.element.setAttribute("aria-label",a.pointDescriptionFormatter&&a.pointDescriptionFormatter(c)||c.buildPointInfoString()))}),1<this.chart.series.length||a.describeSingleSeries)&&(d.setAttribute("role","region"),d.setAttribute("tabindex","-1"),d.setAttribute("aria-label",a.seriesDescriptionFormatter&&a.seriesDescriptionFormatter(this)||this.buildSeriesInfoString()))};
|
||||
e.Series.prototype.buildSeriesInfoString=function(){var a=r[this.type]||r.default,b=this.description||this.options.description;return(this.name?this.name+", ":"")+(1===this.chart.types.length?a[0]:"series")+" "+(this.index+1)+" of "+this.chart.series.length+(1===this.chart.types.length?" with ":". "+a[0]+" with ")+(this.points.length+" "+(1===this.points.length?a[1]:a[2]))+(b?". "+b:"")+(1<this.chart.yAxis.length&&this.yAxis?". Y axis, "+this.yAxis.getDescription():"")+(1<this.chart.xAxis.length&&
|
||||
this.xAxis?". X axis, "+this.xAxis.getDescription():"")};e.Point.prototype.buildPointInfoString=function(){var a=this,b=a.series,d=b.chart.options.accessibility,c="",f=!1,x=b.xAxis&&b.xAxis.isDatetimeAxis,b=x&&C(d.pointDateFormatter&&d.pointDateFormatter(a)||d.pointDateFormat||e.Tooltip.prototype.getXDateFormat(a,b.chart.options.tooltip,b.xAxis),a.x);g(z,function(c){void 0!==a[c]&&(f=!0)});f?(x&&(c=b),g(E.concat(z),function(b){void 0===a[b]||x&&"x"===b||(c+=(c?". ":"")+b+", "+this[b])})):c=(this.name||
|
||||
b||this.category||this.id||"x, "+this.x)+", "+(void 0!==this.value?this.value:this.y);return this.index+1+". "+c+"."+(this.description?" "+this.description:"")};e.Axis.prototype.getDescription=function(){return this.userOptions&&this.userOptions.description||this.axisTitle&&this.axisTitle.textStr||this.options.id||this.categories&&"categories"||"values"};e.Axis.prototype.panStep=function(a,b){var d=b||3;b=this.getExtremes();var c=(b.max-b.min)/d*a,d=b.max+c,c=b.min+c,f=d-c;0>a&&c<b.dataMin?(c=b.dataMin,
|
||||
d=c+f):0<a&&d>b.dataMax&&(d=b.dataMax,c=d-f);this.setExtremes(c,d)};e.wrap(e.Series.prototype,"init",function(a){a.apply(this,Array.prototype.slice.call(arguments,1));var b=this.chart;b.options.accessibility.enabled&&(b.types=b.types||[],0>b.types.indexOf(this.type)&&b.types.push(this.type),v(this,"remove",function(){var a=this,c=!1;g(b.series,function(f){f!==a&&0>b.types.indexOf(a.type)&&(c=!0)});c||A(b.types,a.type)}))});e.Chart.prototype.getTypeDescription=function(){var a=this.types&&this.types[0],
|
||||
b=this.series[0]&&this.series[0].mapTitle;if(a){if("map"===a)return b?"Map of "+b:"Map of unspecified region.";if(1<this.types.length)return"Combination chart.";if(-1<["spline","area","areaspline"].indexOf(a))return"Line chart."}else return"Empty chart.";return a+" chart."+(D[a]||"")};e.Chart.prototype.getAxesDescription=function(){var a=this.xAxis.length,b=this.yAxis.length,d={},c;if(a)if(d.xAxis="The chart has "+a+(1<a?" X axes":" X axis")+" displaying ",2>a)d.xAxis+=this.xAxis[0].getDescription()+
|
||||
".";else{for(c=0;c<a-1;++c)d.xAxis+=(c?", ":"")+this.xAxis[c].getDescription();d.xAxis+=" and "+this.xAxis[c].getDescription()+"."}if(b)if(d.yAxis="The chart has "+b+(1<b?" Y axes":" Y axis")+" displaying ",2>b)d.yAxis+=this.yAxis[0].getDescription()+".";else{for(c=0;c<b-1;++c)d.yAxis+=(c?", ":"")+this.yAxis[c].getDescription();d.yAxis+=" and "+this.yAxis[c].getDescription()+"."}return d};e.Chart.prototype.addAccessibleContextMenuAttribs=function(){var a=this.exportDivElements;a&&(g(a,function(b){"DIV"!==
|
||||
b.tagName||b.children&&b.children.length||(b.setAttribute("role","menuitem"),b.setAttribute("tabindex",-1))}),a[0].parentNode.setAttribute("role","menu"),a[0].parentNode.setAttribute("aria-label","Chart export"))};e.Point.prototype.highlight=function(){var a=this.series.chart;this.graphic&&this.graphic.element.focus&&this.graphic.element.focus();this.isNull?a.tooltip.hide(0):(this.onMouseOver(),a.tooltip.refresh(a.tooltip.shared?[this]:this));a.highlightedPoint=this;return this};e.Chart.prototype.highlightAdjacentPoint=
|
||||
function(a){var b=this.series,d=this.highlightedPoint,c=d&&d.index||0;if(!b[0]||!b[0].points)return!1;if(!d)return b[0].points[0].highlight();if(d.series.points[c]!==d)for(var f=0;f<d.series.points.length;++f)if(d.series.points[f]===d){c=f;break}b=b[d.series.index+(a?1:-1)];d=d.series.points[c+(a?1:-1)]||b&&b.points[a?0:b.points.length-1];return void 0===d?!1:d.isNull&&this.options.accessibility.keyboardNavigation&&this.options.accessibility.keyboardNavigation.skipNullPoints?(this.highlightedPoint=
|
||||
d,this.highlightAdjacentPoint(a)):d.highlight()};e.Chart.prototype.showExportMenu=function(){this.exportSVGElements&&this.exportSVGElements[0]&&(this.exportSVGElements[0].element.onclick(),this.highlightExportItem(0))};e.Chart.prototype.highlightExportItem=function(a){var b=this.exportDivElements&&this.exportDivElements[a],d=this.exportDivElements&&this.exportDivElements[this.highlightedExportItem];if(b&&"DIV"===b.tagName&&(!b.children||!b.children.length)){b.focus&&b.focus();if(d&&d.onmouseout)d.onmouseout();
|
||||
if(b.onmouseover)b.onmouseover();this.highlightedExportItem=a;return!0}};e.Chart.prototype.highlightRangeSelectorButton=function(a){var b=this.rangeSelector.buttons;b[this.highlightedRangeSelectorItemIx]&&b[this.highlightedRangeSelectorItemIx].setState(this.oldRangeSelectorItemState||0);this.highlightedRangeSelectorItemIx=a;return b[a]?(b[a].element.focus&&b[a].element.focus(),this.oldRangeSelectorItemState=b[a].state,b[a].setState(2),!0):!1};e.Chart.prototype.highlightLegendItem=function(a){var b=
|
||||
this.legend.allItems;b[this.highlightedLegendItemIx]&&w(b[this.highlightedLegendItemIx].legendGroup.element,"mouseout");this.highlightedLegendItemIx=a;return b[a]?(b[a].legendGroup.element.focus&&b[a].legendGroup.element.focus(),w(b[a].legendGroup.element,"mouseover"),!0):!1};e.Chart.prototype.hideExportMenu=function(){var a=this.exportDivElements;if(a){g(a,function(b){w(b,"mouseleave")});if(a[this.highlightedExportItem]&&a[this.highlightedExportItem].onmouseout)a[this.highlightedExportItem].onmouseout();
|
||||
this.highlightedExportItem=0;this.renderTo.focus()}};e.Chart.prototype.addKeyboardNavEvents=function(){function a(c){this.keyCodeMap=c.keyCodeMap;this.move=c.move;this.validate=c.validate;this.init=c.init;this.transformTabs=!1!==c.transformTabs}function b(b,d){return new a(u({keyCodeMap:b,move:function(b){c.keyboardNavigationModuleIndex+=b;var a=c.keyboardNavigationModules[c.keyboardNavigationModuleIndex];if(a){if(a.validate&&!a.validate())return this.move(b);if(a.init)return a.init(b),!0}c.keyboardNavigationModuleIndex=
|
||||
0;c.slipNextTab=!0;return!1}},d))}function d(b){b=b||y.event;var a=c.keyboardNavigationModules[c.keyboardNavigationModuleIndex];9===(b.which||b.keyCode)&&c.slipNextTab?c.slipNextTab=!1:(c.slipNextTab=!1,a&&a.run(b)&&b.preventDefault())}var c=this;a.prototype={run:function(c){var b=this,a=c.which||c.keyCode,f=!1,a=this.transformTabs&&9===a?c.shiftKey?37:39:a;g(this.keyCodeMap,function(d){-1<d[0].indexOf(a)&&(f=!1===d[1].call(b,a,c)?!1:!0)});return f}};c.keyboardNavigationModules=[b([[[37,39],function(b){if(!c.highlightAdjacentPoint(39===
|
||||
b))return this.move(39===b?1:-1)}],[[38,40],function(b){var a;if(c.highlightedPoint)if((a=c.series[c.highlightedPoint.series.index+(38===b?-1:1)])&&a.points[0])a.points[0].highlight();else return this.move(40===b?1:-1)}],[[13,32],function(){c.highlightedPoint&&c.highlightedPoint.firePointEvent("click")}]],{init:function(b){var a=c.series&&c.series[c.series.length-1],a=a&&a.points&&a.points[a.points.length-1];0>b&&a&&a.highlight()}}),b([[[37,38],function(){for(var a=c.highlightedExportItem||0,b=!0,
|
||||
d=c.series;a--;)if(c.highlightExportItem(a)){b=!1;break}if(b)return c.hideExportMenu(),d&&d.length&&(a=d[d.length-1],a.points.length&&a.points[a.points.length-1].highlight()),this.move(-1)}],[[39,40],function(){for(var a=!0,b=(c.highlightedExportItem||0)+1;b<c.exportDivElements.length;++b)if(c.highlightExportItem(b)){a=!1;break}if(a)return c.hideExportMenu(),this.move(1)}],[[13,32],function(){q(c.exportDivElements[c.highlightedExportItem])}]],{validate:function(){return c.exportChart&&!(c.options.exporting&&
|
||||
!1===c.options.exporting.enabled)},init:function(a){c.highlightedPoint=null;c.showExportMenu();if(0>a&&c.exportDivElements)for(a=c.exportDivElements.length;-1<a&&!c.highlightExportItem(a);--a);}}),b([[[38,40,37,39],function(a){c[38===a||40===a?"yAxis":"xAxis"][0].panStep(39>a?-1:1)}],[[9],function(a,b){c.mapNavButtons[c.focusedMapNavButtonIx].setState(0);if(b.shiftKey&&!c.focusedMapNavButtonIx||!b.shiftKey&&c.focusedMapNavButtonIx)return c.mapZoom(),this.move(b.shiftKey?-1:1);c.focusedMapNavButtonIx+=
|
||||
b.shiftKey?-1:1;a=c.mapNavButtons[c.focusedMapNavButtonIx];a.element.focus&&a.element.focus();a.setState(2)}],[[13,32],function(){q(c.mapNavButtons[c.focusedMapNavButtonIx].element)}]],{validate:function(){return c.mapZoom&&c.mapNavButtons&&2===c.mapNavButtons.length},transformTabs:!1,init:function(a){var b=c.mapNavButtons[0],d=c.mapNavButtons[1],b=0<a?b:d;g(c.mapNavButtons,function(a,c){a.element.setAttribute("tabindex",-1);a.element.setAttribute("role","button");a.element.setAttribute("aria-label",
|
||||
"Zoom "+(c?"out":"")+"chart")});b.element.focus&&b.element.focus();b.setState(2);c.focusedMapNavButtonIx=0<a?0:1}}),b([[[37,39,38,40],function(a){a=37===a||38===a?-1:1;if(!c.highlightRangeSelectorButton(c.highlightedRangeSelectorItemIx+a))return this.move(a)}],[[13,32],function(){3!==c.oldRangeSelectorItemState&&q(c.rangeSelector.buttons[c.highlightedRangeSelectorItemIx].element)}]],{validate:function(){return c.rangeSelector&&c.rangeSelector.buttons&&c.rangeSelector.buttons.length},init:function(a){g(c.rangeSelector.buttons,
|
||||
function(a){a.element.setAttribute("tabindex","-1");a.element.setAttribute("role","button");a.element.setAttribute("aria-label","Select range "+(a.text&&a.text.textStr))});c.highlightRangeSelectorButton(0<a?0:c.rangeSelector.buttons.length-1)}}),b([[[9,38,40],function(a,b){a=9===a&&b.shiftKey||38===a?-1:1;b=c.highlightedInputRangeIx+=a;if(1<b||0>b)return this.move(a);c.rangeSelector[b?"maxInput":"minInput"].focus()}]],{validate:function(){return c.rangeSelector&&c.rangeSelector.inputGroup&&"hidden"!==
|
||||
c.rangeSelector.inputGroup.element.getAttribute("visibility")&&!1!==c.options.rangeSelector.inputEnabled&&c.rangeSelector.minInput&&c.rangeSelector.maxInput},transformTabs:!1,init:function(a){c.highlightedInputRangeIx=0<a?0:1;c.rangeSelector[c.highlightedInputRangeIx?"maxInput":"minInput"].focus()}}),b([[[37,39,38,40],function(a){a=37===a||38===a?-1:1;if(!c.highlightLegendItem(c.highlightedLegendItemIx+a))return this.move(a)}],[[13,32],function(){q(c.legend.allItems[c.highlightedLegendItemIx].legendItem.element.parentNode)}]],
|
||||
{validate:function(){return c.legend&&c.legend.allItems&&!c.colorAxis},init:function(a){g(c.legend.allItems,function(a){a.legendGroup.element.setAttribute("tabindex","-1");a.legendGroup.element.setAttribute("role","button");a.legendGroup.element.setAttribute("aria-label","Toggle visibility of series "+a.name)});c.highlightLegendItem(0<a?0:c.legend.allItems.length-1)}})];c.keyboardNavigationModuleIndex=0;c.renderTo.tabIndex||c.renderTo.setAttribute("tabindex","0");v(c.renderTo,"keydown",d);v(c,"destroy",
|
||||
function(){B(c.renderTo,"keydown",d)})};e.Chart.prototype.addScreenReaderRegion=function(a){var b=this,d=b.series,c=b.options,e=c.accessibility,g=b.screenReaderRegion=l.createElement("div"),h=l.createElement("h3"),n=l.createElement("a"),p=l.createElement("h3"),t={position:"absolute",left:"-9999px",top:"auto",width:"1px",height:"1px",overflow:"hidden"},k=b.types||[],k=(1===k.length&&"pie"===k[0]||"map"===k[0])&&{}||b.getAxesDescription(),m=d[0]&&r[d[0].type]||r.default;g.setAttribute("role","region");
|
||||
g.setAttribute("aria-label","Chart screen reader information.");g.innerHTML=e.screenReaderSectionFormatter&&e.screenReaderSectionFormatter(b)||'\x3cdiv tabindex\x3d"0"\x3eUse regions/landmarks to skip ahead to chart'+(1<d.length?" and navigate between data series":"")+".\x3c/div\x3e\x3ch3\x3eSummary.\x3c/h3\x3e\x3cdiv\x3e"+(c.title.text||"Chart")+(c.subtitle&&c.subtitle.text?". "+c.subtitle.text:"")+"\x3c/div\x3e\x3ch3\x3eLong description.\x3c/h3\x3e\x3cdiv\x3e"+(c.chart.description||"No description available.")+
|
||||
"\x3c/div\x3e\x3ch3\x3eStructure.\x3c/h3\x3e\x3cdiv\x3eChart type: "+(c.chart.typeDescription||b.getTypeDescription())+"\x3c/div\x3e"+(1===d.length?"\x3cdiv\x3e"+m[0]+" with "+d[0].points.length+" "+(1===d[0].points.length?m[1]:m[2])+".\x3c/div\x3e":"")+(k.xAxis?"\x3cdiv\x3e"+k.xAxis+"\x3c/div\x3e":"")+(k.yAxis?"\x3cdiv\x3e"+k.yAxis+"\x3c/div\x3e":"");b.getCSV&&(n.innerHTML="View as data table.",n.href="#"+a,n.setAttribute("tabindex","-1"),n.onclick=e.onTableAnchorClick||function(){b.viewData();l.getElementById(a).focus()},
|
||||
h.appendChild(n),g.appendChild(h));p.innerHTML="Chart graphic.";b.renderTo.insertBefore(p,b.renderTo.firstChild);b.renderTo.insertBefore(g,b.renderTo.firstChild);u(!0,p.style,t);u(!0,g.style,t)};e.Chart.prototype.callbacks.push(function(a){var b=a.options,d=b.accessibility;if(d.enabled){var c=l.createElementNS("http://www.w3.org/2000/svg","title"),f=l.createElementNS("http://www.w3.org/2000/svg","g"),h=a.container.getElementsByTagName("desc")[0],q=a.container.getElementsByTagName("text"),n="highcharts-title-"+
|
||||
a.index,p="highcharts-data-table-"+a.index,t=b.title.text||"Chart",k=b.exporting&&b.exporting.csv&&b.exporting.csv.columnHeaderFormatter,m=[];c.textContent=t;c.id=n;h.parentNode.insertBefore(c,h);a.renderTo.setAttribute("role","region");a.renderTo.setAttribute("aria-label",t+". Use up and down arrows to navigate.");if(a.exportSVGElements&&a.exportSVGElements[0]&&a.exportSVGElements[0].element){var r=a.exportSVGElements[0].element.onclick,c=a.exportSVGElements[0].element.parentNode;a.exportSVGElements[0].element.onclick=
|
||||
function(){r.apply(this,Array.prototype.slice.call(arguments));a.addAccessibleContextMenuAttribs();a.highlightExportItem(0)};a.exportSVGElements[0].element.setAttribute("role","button");a.exportSVGElements[0].element.setAttribute("aria-label","View export menu");f.appendChild(a.exportSVGElements[0].element);f.setAttribute("role","region");f.setAttribute("aria-label","Chart export menu");c.appendChild(f)}a.rangeSelector&&g(["minInput","maxInput"],function(b,c){a.rangeSelector[b]&&(a.rangeSelector[b].setAttribute("tabindex",
|
||||
"-1"),a.rangeSelector[b].setAttribute("role","textbox"),a.rangeSelector[b].setAttribute("aria-label","Select "+(c?"end":"start")+" date."))});g(q,function(a){a.setAttribute("aria-hidden","true")});a.addScreenReaderRegion(p);d.keyboardNavigation&&a.addKeyboardNavEvents();u(!0,b.exporting,{csv:{columnHeaderFormatter:function(a,b,c){var d=m[m.length-1];1<c&&(d&&d.text)!==a.name&&m.push({text:a.name,span:c});return k?k.call(this,a,b,c):1<c?b:a.name}}});e.wrap(a,"getTable",function(a){return a.apply(this,
|
||||
Array.prototype.slice.call(arguments,1)).replace("\x3ctable\x3e",'\x3ctable id\x3d"'+p+'" summary\x3d"Table representation of chart"\x3e\x3ccaption\x3e'+t+"\x3c/caption\x3e")});e.wrap(a,"viewData",function(a){if(!this.insertedTable){a.apply(this,Array.prototype.slice.call(arguments,1));var b=l.getElementById(p),c=b.getElementsByTagName("tbody")[0],d=c.firstChild.children,e="\x3ctr\x3e\x3ctd\x3e\x3c/td\x3e",f,h;b.setAttribute("tabindex","-1");g(c.children,function(a){f=a.firstChild;h=l.createElement("th");
|
||||
h.setAttribute("scope","row");h.innerHTML=f.innerHTML;f.parentNode.replaceChild(h,f)});g(d,function(a){"TH"===a.tagName&&a.setAttribute("scope","col")});m.length&&(g(m,function(a){e+='\x3cth scope\x3d"col" colspan\x3d"'+a.span+'"\x3e'+a.text+"\x3c/th\x3e"}),c.insertAdjacentHTML("afterbegin",e))}})}})})(h)});
|
1072
assets/plugin/chart/highcharts/code/js/modules/accessibility.src.js
Executable file
1072
assets/plugin/chart/highcharts/code/js/modules/accessibility.src.js
Executable file
File diff suppressed because it is too large
Load Diff
14
assets/plugin/chart/highcharts/code/js/modules/annotations.js
Executable file
14
assets/plugin/chart/highcharts/code/js/modules/annotations.js
Executable file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
Highcharts JS v5.0.2 (2016-10-26)
|
||||
|
||||
(c) 2009-2016 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(n){"object"===typeof module&&module.exports?module.exports=n:n(Highcharts)})(function(n){(function(f){var q=f.defined,k=f.isNumber,n=f.inArray,v=f.isArray,w=f.merge,B=f.Chart,x=f.extend,C=f.each,r,D;D=["path","rect","circle"];r={top:0,left:0,center:.5,middle:.5,bottom:1,right:1};var E=function(){this.init.apply(this,arguments)};E.prototype={init:function(a,d){var c=d.shape&&d.shape.type;this.chart=a;var b;b={xAxis:0,yAxis:0,title:{style:{},text:"",x:0,y:0},shape:{params:{stroke:"#000000",
|
||||
fill:"transparent",strokeWidth:2}}};a={circle:{params:{x:0,y:0}}};a[c]&&(b.shape=w(b.shape,a[c]));this.options=w({},b,d)},render:function(a){var d=this.chart,c=this.chart.renderer,b=this.group,f=this.title,e=this.shape,h=this.options,k=h.title,p=h.shape;b||(b=this.group=c.g());!e&&p&&-1!==n(p.type,D)&&(e=this.shape=c[h.shape.type](p.params),e.add(b));!f&&k&&(f=this.title=c.label(k),f.add(b));b.add(d.annotations.group);this.linkObjects();!1!==a&&this.redraw()},redraw:function(){var a=this.options,
|
||||
d=this.chart,c=this.group,b=this.title,F=this.shape,e=this.linkedObject,h=d.xAxis[a.xAxis],d=d.yAxis[a.yAxis],y=a.width,p=a.height,z=r[a.anchorY],A=r[a.anchorX],t,l,g,u;e&&(t=e instanceof f.Point?"point":e instanceof f.Series?"series":null,"point"===t?(a.xValue=e.x,a.yValue=e.y,l=e.series):"series"===t&&(l=e),c.visibility!==l.group.visibility&&c.attr({visibility:l.group.visibility}));e=q(a.xValue)?h.toPixels(a.xValue+h.minPointOffset)-h.minPixelPadding:a.x;l=q(a.yValue)?d.toPixels(a.yValue):a.y;if(k(e)&&
|
||||
k(l)){b&&(b.attr(a.title),b.css(a.title.style));if(F){b=x({},a.shape.params);if("values"===a.units){for(g in b)-1<n(g,["width","x"])?b[g]=h.translate(b[g]):-1<n(g,["height","y"])&&(b[g]=d.translate(b[g]));b.width&&(b.width-=h.toPixels(0)-h.left);b.x&&(b.x+=h.minPixelPadding);if("path"===a.shape.type){g=b.d;t=e;for(var v=l,w=g.length,m=0;m<w;)k(g[m])&&k(g[m+1])?(g[m]=h.toPixels(g[m])-t,g[m+1]=d.toPixels(g[m+1])-v,m+=2):m+=1}}"circle"===a.shape.type&&(b.x+=b.r,b.y+=b.r);F.attr(b)}c.bBox=null;k(y)||
|
||||
(u=c.getBBox(),y=u.width);k(p)||(u||(u=c.getBBox()),p=u.height);k(A)||(A=r.center);k(z)||(z=r.center);e-=y*A;l-=p*z;q(c.translateX)&&q(c.translateY)?c.animate({translateX:e,translateY:l}):c.translate(e,l)}},destroy:function(){var a=this,d=this.chart.annotations.allItems,c=d.indexOf(a);-1<c&&d.splice(c,1);C(["title","shape","group"],function(b){a[b]&&(a[b].destroy(),a[b]=null)});a.group=a.title=a.shape=a.chart=a.options=null},update:function(a,d){x(this.options,a);this.linkObjects();this.render(d)},
|
||||
linkObjects:function(){var a=this.chart,d=this.linkedObject,c=d&&(d.id||d.options.id),b=this.options.linkedTo;q(b)?q(d)&&b===c||(this.linkedObject=a.get(b)):this.linkedObject=null}};x(B.prototype,{annotations:{add:function(a,d){var c=this.allItems,b=this.chart,f,e;v(a)||(a=[a]);for(e=a.length;e--;)f=new E(b,a[e]),c.push(f),f.render(d)},redraw:function(){C(this.allItems,function(a){a.redraw()})}}});B.prototype.callbacks.push(function(a){var d=a.options.annotations,c;c=a.renderer.g("annotations");c.attr({zIndex:7});
|
||||
c.add();a.annotations.allItems=[];a.annotations.chart=a;a.annotations.group=c;v(d)&&0<d.length&&a.annotations.add(a.options.annotations);f.addEvent(a,"redraw",function(){a.annotations.redraw()})})})(n)});
|
408
assets/plugin/chart/highcharts/code/js/modules/annotations.src.js
Executable file
408
assets/plugin/chart/highcharts/code/js/modules/annotations.src.js
Executable file
@ -0,0 +1,408 @@
|
||||
/**
|
||||
* @license Highcharts JS v5.0.2 (2016-10-26)
|
||||
*
|
||||
* (c) 2009-2016 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
(function(factory) {
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
module.exports = factory;
|
||||
} else {
|
||||
factory(Highcharts);
|
||||
}
|
||||
}(function(Highcharts) {
|
||||
(function(H) {
|
||||
/**
|
||||
* (c) 2009-2016 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var defined = H.defined,
|
||||
isNumber = H.isNumber,
|
||||
inArray = H.inArray,
|
||||
isArray = H.isArray,
|
||||
merge = H.merge,
|
||||
Chart = H.Chart,
|
||||
extend = H.extend,
|
||||
each = H.each;
|
||||
|
||||
var ALIGN_FACTOR,
|
||||
ALLOWED_SHAPES;
|
||||
|
||||
ALLOWED_SHAPES = ['path', 'rect', 'circle'];
|
||||
|
||||
ALIGN_FACTOR = {
|
||||
top: 0,
|
||||
left: 0,
|
||||
center: 0.5,
|
||||
middle: 0.5,
|
||||
bottom: 1,
|
||||
right: 1
|
||||
};
|
||||
|
||||
function defaultOptions(shapeType) {
|
||||
var shapeOptions,
|
||||
options;
|
||||
|
||||
options = {
|
||||
xAxis: 0,
|
||||
yAxis: 0,
|
||||
title: {
|
||||
style: {},
|
||||
text: '',
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
shape: {
|
||||
params: {
|
||||
stroke: '#000000',
|
||||
fill: 'transparent',
|
||||
strokeWidth: 2
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
shapeOptions = {
|
||||
circle: {
|
||||
params: {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (shapeOptions[shapeType]) {
|
||||
options.shape = merge(options.shape, shapeOptions[shapeType]);
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
function translatePath(d, xAxis, yAxis, xOffset, yOffset) {
|
||||
var len = d.length,
|
||||
i = 0;
|
||||
|
||||
while (i < len) {
|
||||
if (isNumber(d[i]) && isNumber(d[i + 1])) {
|
||||
d[i] = xAxis.toPixels(d[i]) - xOffset;
|
||||
d[i + 1] = yAxis.toPixels(d[i + 1]) - yOffset;
|
||||
i += 2;
|
||||
} else {
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
// Define annotation prototype
|
||||
var Annotation = function() {
|
||||
this.init.apply(this, arguments);
|
||||
};
|
||||
Annotation.prototype = {
|
||||
/*
|
||||
* Initialize the annotation
|
||||
*/
|
||||
init: function(chart, options) {
|
||||
var shapeType = options.shape && options.shape.type;
|
||||
|
||||
this.chart = chart;
|
||||
this.options = merge({}, defaultOptions(shapeType), options);
|
||||
},
|
||||
|
||||
/*
|
||||
* Render the annotation
|
||||
*/
|
||||
render: function(redraw) {
|
||||
var annotation = this,
|
||||
chart = this.chart,
|
||||
renderer = annotation.chart.renderer,
|
||||
group = annotation.group,
|
||||
title = annotation.title,
|
||||
shape = annotation.shape,
|
||||
options = annotation.options,
|
||||
titleOptions = options.title,
|
||||
shapeOptions = options.shape;
|
||||
|
||||
if (!group) {
|
||||
group = annotation.group = renderer.g();
|
||||
}
|
||||
|
||||
|
||||
if (!shape && shapeOptions && inArray(shapeOptions.type, ALLOWED_SHAPES) !== -1) {
|
||||
shape = annotation.shape = renderer[options.shape.type](shapeOptions.params);
|
||||
shape.add(group);
|
||||
}
|
||||
|
||||
if (!title && titleOptions) {
|
||||
title = annotation.title = renderer.label(titleOptions);
|
||||
title.add(group);
|
||||
}
|
||||
|
||||
group.add(chart.annotations.group);
|
||||
|
||||
// link annotations to point or series
|
||||
annotation.linkObjects();
|
||||
|
||||
if (redraw !== false) {
|
||||
annotation.redraw();
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Redraw the annotation title or shape after options update
|
||||
*/
|
||||
redraw: function() {
|
||||
var options = this.options,
|
||||
chart = this.chart,
|
||||
group = this.group,
|
||||
title = this.title,
|
||||
shape = this.shape,
|
||||
linkedTo = this.linkedObject,
|
||||
xAxis = chart.xAxis[options.xAxis],
|
||||
yAxis = chart.yAxis[options.yAxis],
|
||||
width = options.width,
|
||||
height = options.height,
|
||||
anchorY = ALIGN_FACTOR[options.anchorY],
|
||||
anchorX = ALIGN_FACTOR[options.anchorX],
|
||||
shapeParams,
|
||||
linkType,
|
||||
series,
|
||||
param,
|
||||
bbox,
|
||||
x,
|
||||
y;
|
||||
|
||||
if (linkedTo) {
|
||||
linkType = (linkedTo instanceof H.Point) ? 'point' :
|
||||
(linkedTo instanceof H.Series) ? 'series' : null;
|
||||
|
||||
if (linkType === 'point') {
|
||||
options.xValue = linkedTo.x;
|
||||
options.yValue = linkedTo.y;
|
||||
series = linkedTo.series;
|
||||
} else if (linkType === 'series') {
|
||||
series = linkedTo;
|
||||
}
|
||||
|
||||
if (group.visibility !== series.group.visibility) {
|
||||
group.attr({
|
||||
visibility: series.group.visibility
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Based on given options find annotation pixel position
|
||||
x = (defined(options.xValue) ? xAxis.toPixels(options.xValue + xAxis.minPointOffset) - xAxis.minPixelPadding : options.x);
|
||||
y = defined(options.yValue) ? yAxis.toPixels(options.yValue) : options.y;
|
||||
|
||||
if (!isNumber(x) || !isNumber(y)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (title) {
|
||||
title.attr(options.title);
|
||||
title.css(options.title.style);
|
||||
}
|
||||
|
||||
if (shape) {
|
||||
shapeParams = extend({}, options.shape.params);
|
||||
|
||||
if (options.units === 'values') {
|
||||
for (param in shapeParams) {
|
||||
if (inArray(param, ['width', 'x']) > -1) {
|
||||
shapeParams[param] = xAxis.translate(shapeParams[param]);
|
||||
} else if (inArray(param, ['height', 'y']) > -1) {
|
||||
shapeParams[param] = yAxis.translate(shapeParams[param]);
|
||||
}
|
||||
}
|
||||
|
||||
if (shapeParams.width) {
|
||||
shapeParams.width -= xAxis.toPixels(0) - xAxis.left;
|
||||
}
|
||||
|
||||
if (shapeParams.x) {
|
||||
shapeParams.x += xAxis.minPixelPadding;
|
||||
}
|
||||
|
||||
if (options.shape.type === 'path') {
|
||||
translatePath(shapeParams.d, xAxis, yAxis, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
// move the center of the circle to shape x/y
|
||||
if (options.shape.type === 'circle') {
|
||||
shapeParams.x += shapeParams.r;
|
||||
shapeParams.y += shapeParams.r;
|
||||
}
|
||||
|
||||
shape.attr(shapeParams);
|
||||
}
|
||||
|
||||
group.bBox = null;
|
||||
|
||||
// If annotation width or height is not defined in options use bounding box size
|
||||
if (!isNumber(width)) {
|
||||
bbox = group.getBBox();
|
||||
width = bbox.width;
|
||||
}
|
||||
|
||||
if (!isNumber(height)) {
|
||||
// get bbox only if it wasn't set before
|
||||
if (!bbox) {
|
||||
bbox = group.getBBox();
|
||||
}
|
||||
|
||||
height = bbox.height;
|
||||
}
|
||||
|
||||
// Calculate anchor point
|
||||
if (!isNumber(anchorX)) {
|
||||
anchorX = ALIGN_FACTOR.center;
|
||||
}
|
||||
|
||||
if (!isNumber(anchorY)) {
|
||||
anchorY = ALIGN_FACTOR.center;
|
||||
}
|
||||
|
||||
// Translate group according to its dimension and anchor point
|
||||
x = x - width * anchorX;
|
||||
y = y - height * anchorY;
|
||||
|
||||
if (defined(group.translateX) && defined(group.translateY)) {
|
||||
group.animate({
|
||||
translateX: x,
|
||||
translateY: y
|
||||
});
|
||||
} else {
|
||||
group.translate(x, y);
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Destroy the annotation
|
||||
*/
|
||||
destroy: function() {
|
||||
var annotation = this,
|
||||
chart = this.chart,
|
||||
allItems = chart.annotations.allItems,
|
||||
index = allItems.indexOf(annotation);
|
||||
|
||||
if (index > -1) {
|
||||
allItems.splice(index, 1);
|
||||
}
|
||||
|
||||
each(['title', 'shape', 'group'], function(element) {
|
||||
if (annotation[element]) {
|
||||
annotation[element].destroy();
|
||||
annotation[element] = null;
|
||||
}
|
||||
});
|
||||
|
||||
annotation.group = annotation.title = annotation.shape = annotation.chart = annotation.options = null;
|
||||
},
|
||||
|
||||
/*
|
||||
* Update the annotation with a given options
|
||||
*/
|
||||
update: function(options, redraw) {
|
||||
extend(this.options, options);
|
||||
|
||||
// update link to point or series
|
||||
this.linkObjects();
|
||||
|
||||
this.render(redraw);
|
||||
},
|
||||
|
||||
linkObjects: function() {
|
||||
var annotation = this,
|
||||
chart = annotation.chart,
|
||||
linkedTo = annotation.linkedObject,
|
||||
linkedId = linkedTo && (linkedTo.id || linkedTo.options.id),
|
||||
options = annotation.options,
|
||||
id = options.linkedTo;
|
||||
|
||||
if (!defined(id)) {
|
||||
annotation.linkedObject = null;
|
||||
} else if (!defined(linkedTo) || id !== linkedId) {
|
||||
annotation.linkedObject = chart.get(id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Add annotations methods to chart prototype
|
||||
extend(Chart.prototype, {
|
||||
annotations: {
|
||||
/*
|
||||
* Unified method for adding annotations to the chart
|
||||
*/
|
||||
add: function(options, redraw) {
|
||||
var annotations = this.allItems,
|
||||
chart = this.chart,
|
||||
item,
|
||||
len;
|
||||
|
||||
if (!isArray(options)) {
|
||||
options = [options];
|
||||
}
|
||||
|
||||
len = options.length;
|
||||
|
||||
while (len--) {
|
||||
item = new Annotation(chart, options[len]);
|
||||
annotations.push(item);
|
||||
item.render(redraw);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Redraw all annotations, method used in chart events
|
||||
*/
|
||||
redraw: function() {
|
||||
each(this.allItems, function(annotation) {
|
||||
annotation.redraw();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Initialize on chart load
|
||||
Chart.prototype.callbacks.push(function(chart) {
|
||||
var options = chart.options.annotations,
|
||||
group;
|
||||
|
||||
group = chart.renderer.g('annotations');
|
||||
group.attr({
|
||||
zIndex: 7
|
||||
});
|
||||
group.add();
|
||||
|
||||
// initialize empty array for annotations
|
||||
chart.annotations.allItems = [];
|
||||
|
||||
// link chart object to annotations
|
||||
chart.annotations.chart = chart;
|
||||
|
||||
// link annotations group element to the chart
|
||||
chart.annotations.group = group;
|
||||
|
||||
if (isArray(options) && options.length > 0) {
|
||||
chart.annotations.add(chart.options.annotations);
|
||||
}
|
||||
|
||||
// update annotations after chart redraw
|
||||
H.addEvent(chart, 'redraw', function() {
|
||||
chart.annotations.redraw();
|
||||
});
|
||||
});
|
||||
|
||||
}(Highcharts));
|
||||
}));
|
22
assets/plugin/chart/highcharts/code/js/modules/boost.js
Executable file
22
assets/plugin/chart/highcharts/code/js/modules/boost.js
Executable file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
Highcharts JS v5.0.2 (2016-10-26)
|
||||
Boost module
|
||||
|
||||
(c) 2010-2016 Highsoft AS
|
||||
Author: Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(f){function p(a,b,c,e,h){h=h||0;e=e||5E4;for(var k=h+e,f=!0;f&&h<k&&h<a.length;)f=b(a[h],h),h+=1;f&&(h<a.length?setTimeout(function(){p(a,b,c,e,h)}):c&&c())}var x=f.win.document,U=function(){},V=f.Color,n=f.Series,d=f.seriesTypes,q=f.each,y=f.extend,W=f.addEvent,X=f.fireEvent,z=f.grep,u=f.isNumber,Y=f.merge,Z=f.pick,l=f.wrap,v=f.getOptions().plotOptions,F;q(["area","arearange","column","line",
|
||||
"scatter"],function(a){v[a]&&(v[a].boostThreshold=5E3)});q(["translate","generatePoints","drawTracker","drawPoints","render"],function(a){function b(b){var c=this.options.stacking&&("translate"===a||"generatePoints"===a);if((this.processedXData||this.options.data).length<(this.options.boostThreshold||Number.MAX_VALUE)||c)"render"===a&&this.image&&(this.image.attr({href:""}),this.animate=null),b.call(this);else if(this[a+"Canvas"])this[a+"Canvas"]()}l(n.prototype,a,b);"translate"===a&&(d.column&&l(d.column.prototype,
|
||||
a,b),d.arearange&&l(d.arearange.prototype,a,b))});l(n.prototype,"getExtremes",function(a){this.hasExtremes()||a.apply(this,Array.prototype.slice.call(arguments,1))});l(n.prototype,"setData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});l(n.prototype,"processData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});f.extend(n.prototype,{pointRange:0,allowDG:!1,hasExtremes:function(a){var b=this.options,c=this.xAxis&&
|
||||
this.xAxis.options,e=this.yAxis&&this.yAxis.options;return b.data.length>(b.boostThreshold||Number.MAX_VALUE)&&u(e.min)&&u(e.max)&&(!a||u(c.min)&&u(c.max))},destroyGraphics:function(){var a=this,b=this.points,c,e;if(b)for(e=0;e<b.length;e+=1)(c=b[e])&&c.graphic&&(c.graphic=c.graphic.destroy());q(["graph","area","tracker"],function(b){a[b]&&(a[b]=a[b].destroy())})},getContext:function(){var a=this.chart,b=a.plotWidth,c=a.plotHeight,e=this.ctx,h=function(a,b,c,e,h,f,d){a.call(this,c,b,e,h,f,d)};this.canvas?
|
||||
e.clearRect(0,0,b,c):(this.canvas=x.createElement("canvas"),this.image=a.renderer.image("",0,0,b,c).add(this.group),this.ctx=e=this.canvas.getContext("2d"),a.inverted&&q(["moveTo","lineTo","rect","arc"],function(a){l(e,a,h)}));this.canvas.width=b;this.canvas.height=c;this.image.attr({width:b,height:c});return e},canvasToSVG:function(){this.image.attr({href:this.canvas.toDataURL("image/png")})},cvsLineTo:function(a,b,c){a.lineTo(b,c)},renderCanvas:function(){var a=this,b=a.options,c=a.chart,e=this.xAxis,
|
||||
h=this.yAxis,k,d=0,l=a.processedXData,n=a.processedYData,q=b.data,m=e.getExtremes(),v=m.min,x=m.max,m=h.getExtremes(),z=m.min,aa=m.max,G={},A,ba=!!a.sampling,H,I=b.marker&&b.marker.radius,J=this.cvsDrawPoint,B=b.lineWidth?this.cvsLineTo:!1,K=1>=I?this.cvsMarkerSquare:this.cvsMarkerCircle,ca=!1!==b.enableMouseTracking,L,m=b.threshold,r=h.getThreshold(m),M=u(m),N=r,da=this.fill,O=a.pointArrayMap&&"low,high"===a.pointArrayMap.join(","),P=!!b.stacking,ea=a.cropStart||0,m=c.options.loading,fa=a.requireSorting,
|
||||
Q,ga=b.connectNulls,R=!l,C,D,t,w,ha=a.fillOpacity?(new V(a.color)).setOpacity(Z(b.fillOpacity,.75)).get():a.color,S=function(){da?(k.fillStyle=ha,k.fill()):(k.strokeStyle=a.color,k.lineWidth=b.lineWidth,k.stroke())},T=function(a,b,c){0===d&&(k.beginPath(),B&&(k.lineJoin="round"));Q?k.moveTo(a,b):J?J(k,a,b,c,L):B?B(k,a,b):K&&K(k,a,b,I);d+=1;1E3===d&&(S(),d=0);L={clientX:a,plotY:b,yBottom:c}},E=function(a,b,f){ca&&!G[a+","+b]&&(G[a+","+b]=!0,c.inverted&&(a=e.len-a,b=h.len-b),H.push({clientX:a,plotX:a,
|
||||
plotY:b,i:ea+f}))};(this.points||this.graph)&&this.destroyGraphics();a.plotGroup("group","series",a.visible?"visible":"hidden",b.zIndex,c.seriesGroup);a.markerGroup=a.group;W(a,"destroy",function(){a.markerGroup=null});H=this.points=[];k=this.getContext();a.buildKDTree=U;99999<q.length&&(c.options.loading=Y(m,{labelStyle:{backgroundColor:f.color("#ffffff").setOpacity(.75).get(),padding:"1em",borderRadius:"0.5em"},style:{backgroundColor:"none",opacity:1}}),clearTimeout(F),c.showLoading("Drawing..."),
|
||||
c.options.loading=m);p(P?a.data:l||q,function(b,f){var d,g,k,l="undefined"===typeof c.index,m=!0;if(!l){R?(d=b[0],g=b[1]):(d=b,g=n[f]);O?(R&&(g=b.slice(1,3)),k=g[0],g=g[1]):P&&(d=b.x,g=b.stackY,k=g-b.y);b=null===g;fa||(m=g>=z&&g<=aa);if(!b&&d>=v&&d<=x&&m)if(d=Math.round(e.toPixels(d,!0)),ba){if(void 0===t||d===A){O||(k=g);if(void 0===w||g>D)D=g,w=f;if(void 0===t||k<C)C=k,t=f}d!==A&&(void 0!==t&&(g=h.toPixels(D,!0),r=h.toPixels(C,!0),T(d,M?Math.min(g,N):g,M?Math.max(r,N):r),E(d,g,w),r!==g&&E(d,r,t)),
|
||||
t=w=void 0,A=d)}else g=Math.round(h.toPixels(g,!0)),T(d,g,r),E(d,g,f);Q=b&&!ga;0===f%5E4&&a.canvasToSVG()}return!l},function(){var b=c.loadingDiv,e=c.loadingShown;S();a.canvasToSVG();X(a,"renderedCanvas");e&&(y(b.style,{transition:"opacity 250ms",opacity:0}),c.loadingShown=!1,F=setTimeout(function(){b.parentNode&&b.parentNode.removeChild(b);c.loadingDiv=c.loadingSpan=null},250));a.directTouch=!1;a.options.stickyTracking=!0;delete a.buildKDTree;a.buildKDTree()},c.renderer.forExport?Number.MAX_VALUE:
|
||||
void 0)}});d.scatter.prototype.cvsMarkerCircle=function(a,b,c,e){a.moveTo(b,c);a.arc(b,c,e,0,2*Math.PI,!1)};d.scatter.prototype.cvsMarkerSquare=function(a,b,c,e){a.rect(b-e,c-e,2*e,2*e)};d.scatter.prototype.fill=!0;y(d.area.prototype,{cvsDrawPoint:function(a,b,c,e,d){d&&b!==d.clientX&&(a.moveTo(d.clientX,d.yBottom),a.lineTo(d.clientX,d.plotY),a.lineTo(b,c),a.lineTo(b,e))},fill:!0,fillOpacity:!0,sampling:!0});y(d.column.prototype,{cvsDrawPoint:function(a,b,c,d){a.rect(b-1,c,1,d-c)},fill:!0,sampling:!0});
|
||||
n.prototype.getPoint=function(a){var b=a;!a||a instanceof this.pointClass||(b=(new this.pointClass).init(this,this.options.data[a.i]),b.category=b.x,b.dist=a.dist,b.distX=a.distX,b.plotX=a.plotX,b.plotY=a.plotY);return b};l(n.prototype,"destroy",function(a){var b=this,c=b.chart;c.hoverPoints&&(c.hoverPoints=z(c.hoverPoints,function(a){return a.series===b}));c.hoverPoint&&c.hoverPoint.series===b&&(c.hoverPoint=null);a.call(this)});l(n.prototype,"searchPoint",function(a){return this.getPoint(a.apply(this,
|
||||
[].slice.call(arguments,1)))})})(p)});
|
636
assets/plugin/chart/highcharts/code/js/modules/boost.src.js
Executable file
636
assets/plugin/chart/highcharts/code/js/modules/boost.src.js
Executable file
@ -0,0 +1,636 @@
|
||||
/**
|
||||
* @license Highcharts JS v5.0.2 (2016-10-26)
|
||||
* Boost module
|
||||
*
|
||||
* (c) 2010-2016 Highsoft AS
|
||||
* Author: Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
(function(factory) {
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
module.exports = factory;
|
||||
} else {
|
||||
factory(Highcharts);
|
||||
}
|
||||
}(function(Highcharts) {
|
||||
(function(H) {
|
||||
/**
|
||||
* License: www.highcharts.com/license
|
||||
* Author: Torstein Honsi
|
||||
*
|
||||
* This is an experimental Highcharts module that draws long data series on a canvas
|
||||
* in order to increase performance of the initial load time and tooltip responsiveness.
|
||||
*
|
||||
* Compatible with HTML5 canvas compatible browsers (not IE < 9).
|
||||
*
|
||||
*
|
||||
*
|
||||
* Development plan
|
||||
* - Column range.
|
||||
* - Heatmap. Modify the heatmap-canvas demo so that it uses this module.
|
||||
* - Treemap.
|
||||
* - Check how it works with Highstock and data grouping. Currently it only works when navigator.adaptToUpdatedData
|
||||
* is false. It is also recommended to set scrollbar.liveRedraw to false.
|
||||
* - Check inverted charts.
|
||||
* - Check reversed axes.
|
||||
* - Chart callback should be async after last series is drawn. (But not necessarily, we don't do
|
||||
that with initial series animation).
|
||||
* - Cache full-size image so we don't have to redraw on hide/show and zoom up. But k-d-tree still
|
||||
* needs to be built.
|
||||
* - Test IE9 and IE10.
|
||||
* - Stacking is not perhaps not correct since it doesn't use the translation given in
|
||||
* the translate method. If this gets to complicated, a possible way out would be to
|
||||
* have a simplified renderCanvas method that simply draws the areaPath on a canvas.
|
||||
*
|
||||
* If this module is taken in as part of the core
|
||||
* - All the loading logic should be merged with core. Update styles in the core.
|
||||
* - Most of the method wraps should probably be added directly in parent methods.
|
||||
*
|
||||
* Notes for boost mode
|
||||
* - Area lines are not drawn
|
||||
* - Point markers are not drawn on line-type series
|
||||
* - Lines are not drawn on scatter charts
|
||||
* - Zones and negativeColor don't work
|
||||
* - Columns are always one pixel wide. Don't set the threshold too low.
|
||||
*
|
||||
* Optimizing tips for users
|
||||
* - For scatter plots, use a marker.radius of 1 or less. It results in a rectangle being drawn, which is
|
||||
* considerably faster than a circle.
|
||||
* - Set extremes (min, max) explicitly on the axes in order for Highcharts to avoid computing extremes.
|
||||
* - Set enableMouseTracking to false on the series to improve total rendering time.
|
||||
* - The default threshold is set based on one series. If you have multiple, dense series, the combined
|
||||
* number of points drawn gets higher, and you may want to set the threshold lower in order to
|
||||
* use optimizations.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var win = H.win,
|
||||
doc = win.document,
|
||||
noop = function() {},
|
||||
Color = H.Color,
|
||||
Series = H.Series,
|
||||
seriesTypes = H.seriesTypes,
|
||||
each = H.each,
|
||||
extend = H.extend,
|
||||
addEvent = H.addEvent,
|
||||
fireEvent = H.fireEvent,
|
||||
grep = H.grep,
|
||||
isNumber = H.isNumber,
|
||||
merge = H.merge,
|
||||
pick = H.pick,
|
||||
wrap = H.wrap,
|
||||
plotOptions = H.getOptions().plotOptions,
|
||||
CHUNK_SIZE = 50000,
|
||||
destroyLoadingDiv;
|
||||
|
||||
function eachAsync(arr, fn, finalFunc, chunkSize, i) {
|
||||
i = i || 0;
|
||||
chunkSize = chunkSize || CHUNK_SIZE;
|
||||
|
||||
var threshold = i + chunkSize,
|
||||
proceed = true;
|
||||
|
||||
while (proceed && i < threshold && i < arr.length) {
|
||||
proceed = fn(arr[i], i);
|
||||
i = i + 1;
|
||||
}
|
||||
if (proceed) {
|
||||
if (i < arr.length) {
|
||||
setTimeout(function() {
|
||||
eachAsync(arr, fn, finalFunc, chunkSize, i);
|
||||
});
|
||||
} else if (finalFunc) {
|
||||
finalFunc();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set default options
|
||||
each(['area', 'arearange', 'column', 'line', 'scatter'], function(type) {
|
||||
if (plotOptions[type]) {
|
||||
plotOptions[type].boostThreshold = 5000;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Override a bunch of methods the same way. If the number of points is below the threshold,
|
||||
* run the original method. If not, check for a canvas version or do nothing.
|
||||
*/
|
||||
each(['translate', 'generatePoints', 'drawTracker', 'drawPoints', 'render'], function(method) {
|
||||
function branch(proceed) {
|
||||
var letItPass = this.options.stacking && (method === 'translate' || method === 'generatePoints');
|
||||
if ((this.processedXData || this.options.data).length < (this.options.boostThreshold || Number.MAX_VALUE) ||
|
||||
letItPass) {
|
||||
|
||||
// Clear image
|
||||
if (method === 'render' && this.image) {
|
||||
this.image.attr({
|
||||
href: ''
|
||||
});
|
||||
this.animate = null; // We're zooming in, don't run animation
|
||||
}
|
||||
|
||||
proceed.call(this);
|
||||
|
||||
// If a canvas version of the method exists, like renderCanvas(), run
|
||||
} else if (this[method + 'Canvas']) {
|
||||
|
||||
this[method + 'Canvas']();
|
||||
}
|
||||
}
|
||||
wrap(Series.prototype, method, branch);
|
||||
|
||||
// A special case for some types - its translate method is already wrapped
|
||||
if (method === 'translate') {
|
||||
if (seriesTypes.column) {
|
||||
wrap(seriesTypes.column.prototype, method, branch);
|
||||
}
|
||||
if (seriesTypes.arearange) {
|
||||
wrap(seriesTypes.arearange.prototype, method, branch);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Do not compute extremes when min and max are set.
|
||||
* If we use this in the core, we can add the hook to hasExtremes to the methods directly.
|
||||
*/
|
||||
wrap(Series.prototype, 'getExtremes', function(proceed) {
|
||||
if (!this.hasExtremes()) {
|
||||
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
}
|
||||
});
|
||||
wrap(Series.prototype, 'setData', function(proceed) {
|
||||
if (!this.hasExtremes(true)) {
|
||||
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
}
|
||||
});
|
||||
wrap(Series.prototype, 'processData', function(proceed) {
|
||||
if (!this.hasExtremes(true)) {
|
||||
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
H.extend(Series.prototype, {
|
||||
pointRange: 0,
|
||||
allowDG: false, // No data grouping, let boost handle large data
|
||||
hasExtremes: function(checkX) {
|
||||
var options = this.options,
|
||||
data = options.data,
|
||||
xAxis = this.xAxis && this.xAxis.options,
|
||||
yAxis = this.yAxis && this.yAxis.options;
|
||||
return data.length > (options.boostThreshold || Number.MAX_VALUE) && isNumber(yAxis.min) && isNumber(yAxis.max) &&
|
||||
(!checkX || (isNumber(xAxis.min) && isNumber(xAxis.max)));
|
||||
},
|
||||
|
||||
/**
|
||||
* If implemented in the core, parts of this can probably be shared with other similar
|
||||
* methods in Highcharts.
|
||||
*/
|
||||
destroyGraphics: function() {
|
||||
var series = this,
|
||||
points = this.points,
|
||||
point,
|
||||
i;
|
||||
|
||||
if (points) {
|
||||
for (i = 0; i < points.length; i = i + 1) {
|
||||
point = points[i];
|
||||
if (point && point.graphic) {
|
||||
point.graphic = point.graphic.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
each(['graph', 'area', 'tracker'], function(prop) {
|
||||
if (series[prop]) {
|
||||
series[prop] = series[prop].destroy();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Create a hidden canvas to draw the graph on. The contents is later copied over
|
||||
* to an SVG image element.
|
||||
*/
|
||||
getContext: function() {
|
||||
var chart = this.chart,
|
||||
width = chart.plotWidth,
|
||||
height = chart.plotHeight,
|
||||
ctx = this.ctx,
|
||||
swapXY = function(proceed, x, y, a, b, c, d) {
|
||||
proceed.call(this, y, x, a, b, c, d);
|
||||
};
|
||||
|
||||
if (!this.canvas) {
|
||||
this.canvas = doc.createElement('canvas');
|
||||
this.image = chart.renderer.image('', 0, 0, width, height).add(this.group);
|
||||
this.ctx = ctx = this.canvas.getContext('2d');
|
||||
if (chart.inverted) {
|
||||
each(['moveTo', 'lineTo', 'rect', 'arc'], function(fn) {
|
||||
wrap(ctx, fn, swapXY);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
ctx.clearRect(0, 0, width, height);
|
||||
}
|
||||
|
||||
this.canvas.width = width;
|
||||
this.canvas.height = height;
|
||||
this.image.attr({
|
||||
width: width,
|
||||
height: height
|
||||
});
|
||||
|
||||
return ctx;
|
||||
},
|
||||
|
||||
/**
|
||||
* Draw the canvas image inside an SVG image
|
||||
*/
|
||||
canvasToSVG: function() {
|
||||
this.image.attr({
|
||||
href: this.canvas.toDataURL('image/png')
|
||||
});
|
||||
},
|
||||
|
||||
cvsLineTo: function(ctx, clientX, plotY) {
|
||||
ctx.lineTo(clientX, plotY);
|
||||
},
|
||||
|
||||
renderCanvas: function() {
|
||||
var series = this,
|
||||
options = series.options,
|
||||
chart = series.chart,
|
||||
xAxis = this.xAxis,
|
||||
yAxis = this.yAxis,
|
||||
ctx,
|
||||
c = 0,
|
||||
xData = series.processedXData,
|
||||
yData = series.processedYData,
|
||||
rawData = options.data,
|
||||
xExtremes = xAxis.getExtremes(),
|
||||
xMin = xExtremes.min,
|
||||
xMax = xExtremes.max,
|
||||
yExtremes = yAxis.getExtremes(),
|
||||
yMin = yExtremes.min,
|
||||
yMax = yExtremes.max,
|
||||
pointTaken = {},
|
||||
lastClientX,
|
||||
sampling = !!series.sampling,
|
||||
points,
|
||||
r = options.marker && options.marker.radius,
|
||||
cvsDrawPoint = this.cvsDrawPoint,
|
||||
cvsLineTo = options.lineWidth ? this.cvsLineTo : false,
|
||||
cvsMarker = r <= 1 ? this.cvsMarkerSquare : this.cvsMarkerCircle,
|
||||
enableMouseTracking = options.enableMouseTracking !== false,
|
||||
lastPoint,
|
||||
threshold = options.threshold,
|
||||
yBottom = yAxis.getThreshold(threshold),
|
||||
hasThreshold = isNumber(threshold),
|
||||
translatedThreshold = yBottom,
|
||||
doFill = this.fill,
|
||||
isRange = series.pointArrayMap && series.pointArrayMap.join(',') === 'low,high',
|
||||
isStacked = !!options.stacking,
|
||||
cropStart = series.cropStart || 0,
|
||||
loadingOptions = chart.options.loading,
|
||||
requireSorting = series.requireSorting,
|
||||
wasNull,
|
||||
connectNulls = options.connectNulls,
|
||||
useRaw = !xData,
|
||||
minVal,
|
||||
maxVal,
|
||||
minI,
|
||||
maxI,
|
||||
fillColor = series.fillOpacity ?
|
||||
new Color(series.color).setOpacity(pick(options.fillOpacity, 0.75)).get() :
|
||||
series.color,
|
||||
stroke = function() {
|
||||
if (doFill) {
|
||||
ctx.fillStyle = fillColor;
|
||||
ctx.fill();
|
||||
} else {
|
||||
ctx.strokeStyle = series.color;
|
||||
ctx.lineWidth = options.lineWidth;
|
||||
ctx.stroke();
|
||||
}
|
||||
},
|
||||
drawPoint = function(clientX, plotY, yBottom) {
|
||||
if (c === 0) {
|
||||
ctx.beginPath();
|
||||
|
||||
if (cvsLineTo) {
|
||||
ctx.lineJoin = 'round';
|
||||
}
|
||||
}
|
||||
|
||||
if (wasNull) {
|
||||
ctx.moveTo(clientX, plotY);
|
||||
} else {
|
||||
if (cvsDrawPoint) {
|
||||
cvsDrawPoint(ctx, clientX, plotY, yBottom, lastPoint);
|
||||
} else if (cvsLineTo) {
|
||||
cvsLineTo(ctx, clientX, plotY);
|
||||
} else if (cvsMarker) {
|
||||
cvsMarker(ctx, clientX, plotY, r);
|
||||
}
|
||||
}
|
||||
|
||||
// We need to stroke the line for every 1000 pixels. It will crash the browser
|
||||
// memory use if we stroke too infrequently.
|
||||
c = c + 1;
|
||||
if (c === 1000) {
|
||||
stroke();
|
||||
c = 0;
|
||||
}
|
||||
|
||||
// Area charts need to keep track of the last point
|
||||
lastPoint = {
|
||||
clientX: clientX,
|
||||
plotY: plotY,
|
||||
yBottom: yBottom
|
||||
};
|
||||
},
|
||||
|
||||
addKDPoint = function(clientX, plotY, i) {
|
||||
|
||||
// The k-d tree requires series points. Reduce the amount of points, since the time to build the
|
||||
// tree increases exponentially.
|
||||
if (enableMouseTracking && !pointTaken[clientX + ',' + plotY]) {
|
||||
pointTaken[clientX + ',' + plotY] = true;
|
||||
|
||||
if (chart.inverted) {
|
||||
clientX = xAxis.len - clientX;
|
||||
plotY = yAxis.len - plotY;
|
||||
}
|
||||
|
||||
points.push({
|
||||
clientX: clientX,
|
||||
plotX: clientX,
|
||||
plotY: plotY,
|
||||
i: cropStart + i
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// If we are zooming out from SVG mode, destroy the graphics
|
||||
if (this.points || this.graph) {
|
||||
this.destroyGraphics();
|
||||
}
|
||||
|
||||
// The group
|
||||
series.plotGroup(
|
||||
'group',
|
||||
'series',
|
||||
series.visible ? 'visible' : 'hidden',
|
||||
options.zIndex,
|
||||
chart.seriesGroup
|
||||
);
|
||||
|
||||
series.markerGroup = series.group;
|
||||
addEvent(series, 'destroy', function() {
|
||||
series.markerGroup = null;
|
||||
});
|
||||
|
||||
points = this.points = [];
|
||||
ctx = this.getContext();
|
||||
series.buildKDTree = noop; // Do not start building while drawing
|
||||
|
||||
// Display a loading indicator
|
||||
if (rawData.length > 99999) {
|
||||
chart.options.loading = merge(loadingOptions, {
|
||||
labelStyle: {
|
||||
backgroundColor: H.color('#ffffff').setOpacity(0.75).get(),
|
||||
padding: '1em',
|
||||
borderRadius: '0.5em'
|
||||
},
|
||||
style: {
|
||||
backgroundColor: 'none',
|
||||
opacity: 1
|
||||
}
|
||||
});
|
||||
clearTimeout(destroyLoadingDiv);
|
||||
chart.showLoading('Drawing...');
|
||||
chart.options.loading = loadingOptions; // reset
|
||||
}
|
||||
|
||||
// Loop over the points
|
||||
eachAsync(isStacked ? series.data : (xData || rawData), function(d, i) {
|
||||
var x,
|
||||
y,
|
||||
clientX,
|
||||
plotY,
|
||||
isNull,
|
||||
low,
|
||||
chartDestroyed = typeof chart.index === 'undefined',
|
||||
isYInside = true;
|
||||
|
||||
if (!chartDestroyed) {
|
||||
if (useRaw) {
|
||||
x = d[0];
|
||||
y = d[1];
|
||||
} else {
|
||||
x = d;
|
||||
y = yData[i];
|
||||
}
|
||||
|
||||
// Resolve low and high for range series
|
||||
if (isRange) {
|
||||
if (useRaw) {
|
||||
y = d.slice(1, 3);
|
||||
}
|
||||
low = y[0];
|
||||
y = y[1];
|
||||
} else if (isStacked) {
|
||||
x = d.x;
|
||||
y = d.stackY;
|
||||
low = y - d.y;
|
||||
}
|
||||
|
||||
isNull = y === null;
|
||||
|
||||
// Optimize for scatter zooming
|
||||
if (!requireSorting) {
|
||||
isYInside = y >= yMin && y <= yMax;
|
||||
}
|
||||
|
||||
if (!isNull && x >= xMin && x <= xMax && isYInside) {
|
||||
|
||||
clientX = Math.round(xAxis.toPixels(x, true));
|
||||
|
||||
if (sampling) {
|
||||
if (minI === undefined || clientX === lastClientX) {
|
||||
if (!isRange) {
|
||||
low = y;
|
||||
}
|
||||
if (maxI === undefined || y > maxVal) {
|
||||
maxVal = y;
|
||||
maxI = i;
|
||||
}
|
||||
if (minI === undefined || low < minVal) {
|
||||
minVal = low;
|
||||
minI = i;
|
||||
}
|
||||
|
||||
}
|
||||
if (clientX !== lastClientX) { // Add points and reset
|
||||
if (minI !== undefined) { // then maxI is also a number
|
||||
plotY = yAxis.toPixels(maxVal, true);
|
||||
yBottom = yAxis.toPixels(minVal, true);
|
||||
drawPoint(
|
||||
clientX,
|
||||
hasThreshold ? Math.min(plotY, translatedThreshold) : plotY,
|
||||
hasThreshold ? Math.max(yBottom, translatedThreshold) : yBottom
|
||||
);
|
||||
addKDPoint(clientX, plotY, maxI);
|
||||
if (yBottom !== plotY) {
|
||||
addKDPoint(clientX, yBottom, minI);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
minI = maxI = undefined;
|
||||
lastClientX = clientX;
|
||||
}
|
||||
} else {
|
||||
plotY = Math.round(yAxis.toPixels(y, true));
|
||||
drawPoint(clientX, plotY, yBottom);
|
||||
addKDPoint(clientX, plotY, i);
|
||||
}
|
||||
}
|
||||
wasNull = isNull && !connectNulls;
|
||||
|
||||
if (i % CHUNK_SIZE === 0) {
|
||||
series.canvasToSVG();
|
||||
}
|
||||
}
|
||||
|
||||
return !chartDestroyed;
|
||||
}, function() {
|
||||
var loadingDiv = chart.loadingDiv,
|
||||
loadingShown = chart.loadingShown;
|
||||
stroke();
|
||||
series.canvasToSVG();
|
||||
|
||||
fireEvent(series, 'renderedCanvas');
|
||||
|
||||
// Do not use chart.hideLoading, as it runs JS animation and will be blocked by buildKDTree.
|
||||
// CSS animation looks good, but then it must be deleted in timeout. If we add the module to core,
|
||||
// change hideLoading so we can skip this block.
|
||||
if (loadingShown) {
|
||||
extend(loadingDiv.style, {
|
||||
transition: 'opacity 250ms',
|
||||
opacity: 0
|
||||
});
|
||||
chart.loadingShown = false;
|
||||
destroyLoadingDiv = setTimeout(function() {
|
||||
if (loadingDiv.parentNode) { // In exporting it is falsy
|
||||
loadingDiv.parentNode.removeChild(loadingDiv);
|
||||
}
|
||||
chart.loadingDiv = chart.loadingSpan = null;
|
||||
}, 250);
|
||||
}
|
||||
|
||||
// Pass tests in Pointer.
|
||||
// Replace this with a single property, and replace when zooming in
|
||||
// below boostThreshold.
|
||||
series.directTouch = false;
|
||||
series.options.stickyTracking = true;
|
||||
|
||||
delete series.buildKDTree; // Go back to prototype, ready to build
|
||||
series.buildKDTree();
|
||||
|
||||
// Don't do async on export, the exportChart, getSVGForExport and getSVG methods are not chained for it.
|
||||
}, chart.renderer.forExport ? Number.MAX_VALUE : undefined);
|
||||
}
|
||||
});
|
||||
|
||||
seriesTypes.scatter.prototype.cvsMarkerCircle = function(ctx, clientX, plotY, r) {
|
||||
ctx.moveTo(clientX, plotY);
|
||||
ctx.arc(clientX, plotY, r, 0, 2 * Math.PI, false);
|
||||
};
|
||||
|
||||
// Rect is twice as fast as arc, should be used for small markers
|
||||
seriesTypes.scatter.prototype.cvsMarkerSquare = function(ctx, clientX, plotY, r) {
|
||||
ctx.rect(clientX - r, plotY - r, r * 2, r * 2);
|
||||
};
|
||||
seriesTypes.scatter.prototype.fill = true;
|
||||
|
||||
extend(seriesTypes.area.prototype, {
|
||||
cvsDrawPoint: function(ctx, clientX, plotY, yBottom, lastPoint) {
|
||||
if (lastPoint && clientX !== lastPoint.clientX) {
|
||||
ctx.moveTo(lastPoint.clientX, lastPoint.yBottom);
|
||||
ctx.lineTo(lastPoint.clientX, lastPoint.plotY);
|
||||
ctx.lineTo(clientX, plotY);
|
||||
ctx.lineTo(clientX, yBottom);
|
||||
}
|
||||
},
|
||||
fill: true,
|
||||
fillOpacity: true,
|
||||
sampling: true
|
||||
});
|
||||
|
||||
extend(seriesTypes.column.prototype, {
|
||||
cvsDrawPoint: function(ctx, clientX, plotY, yBottom) {
|
||||
ctx.rect(clientX - 1, plotY, 1, yBottom - plotY);
|
||||
},
|
||||
fill: true,
|
||||
sampling: true
|
||||
});
|
||||
|
||||
/**
|
||||
* Return a full Point object based on the index. The boost module uses stripped point objects
|
||||
* for performance reasons.
|
||||
* @param {Number} boostPoint A stripped-down point object
|
||||
* @returns {Object} A Point object as per http://api.highcharts.com/highcharts#Point
|
||||
*/
|
||||
Series.prototype.getPoint = function(boostPoint) {
|
||||
var point = boostPoint;
|
||||
|
||||
if (boostPoint && !(boostPoint instanceof this.pointClass)) {
|
||||
point = (new this.pointClass()).init(this, this.options.data[boostPoint.i]); // eslint-disable-line new-cap
|
||||
point.category = point.x;
|
||||
|
||||
point.dist = boostPoint.dist;
|
||||
point.distX = boostPoint.distX;
|
||||
point.plotX = boostPoint.plotX;
|
||||
point.plotY = boostPoint.plotY;
|
||||
}
|
||||
|
||||
return point;
|
||||
};
|
||||
|
||||
/**
|
||||
* Extend series.destroy to also remove the fake k-d-tree points (#5137). Normally
|
||||
* this is handled by Series.destroy that calls Point.destroy, but the fake
|
||||
* search points are not registered like that.
|
||||
*/
|
||||
wrap(Series.prototype, 'destroy', function(proceed) {
|
||||
var series = this,
|
||||
chart = series.chart;
|
||||
if (chart.hoverPoints) {
|
||||
chart.hoverPoints = grep(chart.hoverPoints, function(point) {
|
||||
return point.series === series;
|
||||
});
|
||||
}
|
||||
|
||||
if (chart.hoverPoint && chart.hoverPoint.series === series) {
|
||||
chart.hoverPoint = null;
|
||||
}
|
||||
proceed.call(this);
|
||||
});
|
||||
|
||||
/**
|
||||
* Return a point instance from the k-d-tree
|
||||
*/
|
||||
wrap(Series.prototype, 'searchPoint', function(proceed) {
|
||||
return this.getPoint(
|
||||
proceed.apply(this, [].slice.call(arguments, 1))
|
||||
);
|
||||
});
|
||||
|
||||
}(Highcharts));
|
||||
}));
|
14
assets/plugin/chart/highcharts/code/js/modules/broken-axis.js
Executable file
14
assets/plugin/chart/highcharts/code/js/modules/broken-axis.js
Executable file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
Highcharts JS v5.0.2 (2016-10-26)
|
||||
|
||||
(c) 2009-2016 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(h){"object"===typeof module&&module.exports?module.exports=h:h(Highcharts)})(function(h){(function(f){function h(){return Array.prototype.slice.call(arguments,1)}function u(g){g.apply(this);this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,r(this.pointArrayMap,["y"]))}var r=f.pick,p=f.wrap,t=f.each,x=f.extend,v=f.fireEvent,q=f.Axis,y=f.Series;x(q.prototype,{isInBreak:function(g,c){var d=g.repeat||Infinity,b=g.from,a=g.to-g.from;c=c>=b?(c-b)%d:d-(b-c)%d;return g.inclusive?c<=a:
|
||||
c<a&&0!==c},isInAnyBreak:function(g,c){var d=this.options.breaks,b=d&&d.length,a,e,m;if(b){for(;b--;)this.isInBreak(d[b],g)&&(a=!0,e||(e=r(d[b].showPoints,this.isXAxis?!1:!0)));m=a&&c?a&&!e:a}return m}});p(q.prototype,"setTickPositions",function(g){g.apply(this,Array.prototype.slice.call(arguments,1));if(this.options.breaks){var c=this.tickPositions,d=this.tickPositions.info,b=[],a;for(a=0;a<c.length;a++)this.isInAnyBreak(c[a])||b.push(c[a]);this.tickPositions=b;this.tickPositions.info=d}});p(q.prototype,
|
||||
"init",function(g,c,d){d.breaks&&d.breaks.length&&(d.ordinal=!1);g.call(this,c,d);if(this.options.breaks){var b=this;b.isBroken=!0;this.val2lin=function(a){var e=a,m,d;for(d=0;d<b.breakArray.length;d++)if(m=b.breakArray[d],m.to<=a)e-=m.len;else if(m.from>=a)break;else if(b.isInBreak(m,a)){e-=a-m.from;break}return e};this.lin2val=function(a){var e,d;for(d=0;d<b.breakArray.length&&!(e=b.breakArray[d],e.from>=a);d++)e.to<a?a+=e.len:b.isInBreak(e,a)&&(a+=e.len);return a};this.setExtremes=function(a,b,
|
||||
d,g,c){for(;this.isInAnyBreak(a);)a-=this.closestPointRange;for(;this.isInAnyBreak(b);)b-=this.closestPointRange;q.prototype.setExtremes.call(this,a,b,d,g,c)};this.setAxisTranslation=function(a){q.prototype.setAxisTranslation.call(this,a);var e=b.options.breaks;a=[];var d=[],g=0,c,k,n=b.userMin||b.min,f=b.userMax||b.max,l,h;for(h in e)k=e[h],c=k.repeat||Infinity,b.isInBreak(k,n)&&(n+=k.to%c-n%c),b.isInBreak(k,f)&&(f-=f%c-k.from%c);for(h in e){k=e[h];l=k.from;for(c=k.repeat||Infinity;l-c>n;)l-=c;for(;l<
|
||||
n;)l+=c;for(;l<f;l+=c)a.push({value:l,move:"in"}),a.push({value:l+(k.to-k.from),move:"out",size:k.breakSize})}a.sort(function(a,b){return a.value===b.value?("in"===a.move?0:1)-("in"===b.move?0:1):a.value-b.value});e=0;l=n;for(h in a)k=a[h],e+="in"===k.move?1:-1,1===e&&"in"===k.move&&(l=k.value),0===e&&(d.push({from:l,to:k.value,len:k.value-l-(k.size||0)}),g+=k.value-l-(k.size||0));b.breakArray=d;v(b,"afterBreaks");b.transA*=(f-b.min)/(f-n-g);b.min=n;b.max=f}}});p(y.prototype,"generatePoints",function(g){g.apply(this,
|
||||
h(arguments));var c=this.xAxis,d=this.yAxis,b=this.points,a,e=b.length,f=this.options.connectNulls,w;if(c&&d&&(c.options.breaks||d.options.breaks))for(;e--;)a=b[e],w=null===a.y&&!1===f,w||!c.isInAnyBreak(a.x,!0)&&!d.isInAnyBreak(a.y,!0)||(b.splice(e,1),this.data[e]&&this.data[e].destroyElements())});f.Series.prototype.drawBreaks=function(g,c){var d=this,b=d.points,a,e,f,h;t(c,function(c){a=g.breakArray||[];e=g.isXAxis?g.min:r(d.options.threshold,g.min);t(b,function(b){h=r(b["stack"+c.toUpperCase()],
|
||||
b[c]);t(a,function(a){f=!1;if(e<a.from&&h>a.to||e>a.from&&h<a.from)f="pointBreak";else if(e<a.from&&h>a.from&&h<a.to||e>a.from&&h>a.to&&h<a.from)f="pointInBreak";f&&v(g,f,{point:b,brk:a})})})})};p(f.seriesTypes.column.prototype,"drawPoints",u);p(f.Series.prototype,"drawPoints",u)})(h)});
|
334
assets/plugin/chart/highcharts/code/js/modules/broken-axis.src.js
Executable file
334
assets/plugin/chart/highcharts/code/js/modules/broken-axis.src.js
Executable file
@ -0,0 +1,334 @@
|
||||
/**
|
||||
* @license Highcharts JS v5.0.2 (2016-10-26)
|
||||
*
|
||||
* (c) 2009-2016 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
(function(factory) {
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
module.exports = factory;
|
||||
} else {
|
||||
factory(Highcharts);
|
||||
}
|
||||
}(function(Highcharts) {
|
||||
(function(H) {
|
||||
/**
|
||||
* (c) 2009-2016 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var pick = H.pick,
|
||||
wrap = H.wrap,
|
||||
each = H.each,
|
||||
extend = H.extend,
|
||||
fireEvent = H.fireEvent,
|
||||
Axis = H.Axis,
|
||||
Series = H.Series;
|
||||
|
||||
function stripArguments() {
|
||||
return Array.prototype.slice.call(arguments, 1);
|
||||
}
|
||||
|
||||
extend(Axis.prototype, {
|
||||
isInBreak: function(brk, val) {
|
||||
var ret,
|
||||
repeat = brk.repeat || Infinity,
|
||||
from = brk.from,
|
||||
length = brk.to - brk.from,
|
||||
test = (val >= from ? (val - from) % repeat : repeat - ((from - val) % repeat));
|
||||
|
||||
if (!brk.inclusive) {
|
||||
ret = test < length && test !== 0;
|
||||
} else {
|
||||
ret = test <= length;
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
|
||||
isInAnyBreak: function(val, testKeep) {
|
||||
|
||||
var breaks = this.options.breaks,
|
||||
i = breaks && breaks.length,
|
||||
inbrk,
|
||||
keep,
|
||||
ret;
|
||||
|
||||
|
||||
if (i) {
|
||||
|
||||
while (i--) {
|
||||
if (this.isInBreak(breaks[i], val)) {
|
||||
inbrk = true;
|
||||
if (!keep) {
|
||||
keep = pick(breaks[i].showPoints, this.isXAxis ? false : true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inbrk && testKeep) {
|
||||
ret = inbrk && !keep;
|
||||
} else {
|
||||
ret = inbrk;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
});
|
||||
|
||||
wrap(Axis.prototype, 'setTickPositions', function(proceed) {
|
||||
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
|
||||
if (this.options.breaks) {
|
||||
var axis = this,
|
||||
tickPositions = this.tickPositions,
|
||||
info = this.tickPositions.info,
|
||||
newPositions = [],
|
||||
i;
|
||||
|
||||
for (i = 0; i < tickPositions.length; i++) {
|
||||
if (!axis.isInAnyBreak(tickPositions[i])) {
|
||||
newPositions.push(tickPositions[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.tickPositions = newPositions;
|
||||
this.tickPositions.info = info;
|
||||
}
|
||||
});
|
||||
|
||||
wrap(Axis.prototype, 'init', function(proceed, chart, userOptions) {
|
||||
// Force Axis to be not-ordinal when breaks are defined
|
||||
if (userOptions.breaks && userOptions.breaks.length) {
|
||||
userOptions.ordinal = false;
|
||||
}
|
||||
|
||||
proceed.call(this, chart, userOptions);
|
||||
|
||||
if (this.options.breaks) {
|
||||
|
||||
var axis = this;
|
||||
|
||||
axis.isBroken = true;
|
||||
|
||||
this.val2lin = function(val) {
|
||||
var nval = val,
|
||||
brk,
|
||||
i;
|
||||
|
||||
for (i = 0; i < axis.breakArray.length; i++) {
|
||||
brk = axis.breakArray[i];
|
||||
if (brk.to <= val) {
|
||||
nval -= brk.len;
|
||||
} else if (brk.from >= val) {
|
||||
break;
|
||||
} else if (axis.isInBreak(brk, val)) {
|
||||
nval -= (val - brk.from);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return nval;
|
||||
};
|
||||
|
||||
this.lin2val = function(val) {
|
||||
var nval = val,
|
||||
brk,
|
||||
i;
|
||||
|
||||
for (i = 0; i < axis.breakArray.length; i++) {
|
||||
brk = axis.breakArray[i];
|
||||
if (brk.from >= nval) {
|
||||
break;
|
||||
} else if (brk.to < nval) {
|
||||
nval += brk.len;
|
||||
} else if (axis.isInBreak(brk, nval)) {
|
||||
nval += brk.len;
|
||||
}
|
||||
}
|
||||
return nval;
|
||||
};
|
||||
|
||||
this.setExtremes = function(newMin, newMax, redraw, animation, eventArguments) {
|
||||
// If trying to set extremes inside a break, extend it to before and after the break ( #3857 )
|
||||
while (this.isInAnyBreak(newMin)) {
|
||||
newMin -= this.closestPointRange;
|
||||
}
|
||||
while (this.isInAnyBreak(newMax)) {
|
||||
newMax -= this.closestPointRange;
|
||||
}
|
||||
Axis.prototype.setExtremes.call(this, newMin, newMax, redraw, animation, eventArguments);
|
||||
};
|
||||
|
||||
this.setAxisTranslation = function(saveOld) {
|
||||
Axis.prototype.setAxisTranslation.call(this, saveOld);
|
||||
|
||||
var breaks = axis.options.breaks,
|
||||
breakArrayT = [], // Temporary one
|
||||
breakArray = [],
|
||||
length = 0,
|
||||
inBrk,
|
||||
repeat,
|
||||
brk,
|
||||
min = axis.userMin || axis.min,
|
||||
max = axis.userMax || axis.max,
|
||||
start,
|
||||
i,
|
||||
j;
|
||||
|
||||
// Min & max check (#4247)
|
||||
for (i in breaks) {
|
||||
brk = breaks[i];
|
||||
repeat = brk.repeat || Infinity;
|
||||
if (axis.isInBreak(brk, min)) {
|
||||
min += (brk.to % repeat) - (min % repeat);
|
||||
}
|
||||
if (axis.isInBreak(brk, max)) {
|
||||
max -= (max % repeat) - (brk.from % repeat);
|
||||
}
|
||||
}
|
||||
|
||||
// Construct an array holding all breaks in the axis
|
||||
for (i in breaks) {
|
||||
brk = breaks[i];
|
||||
start = brk.from;
|
||||
repeat = brk.repeat || Infinity;
|
||||
|
||||
while (start - repeat > min) {
|
||||
start -= repeat;
|
||||
}
|
||||
while (start < min) {
|
||||
start += repeat;
|
||||
}
|
||||
|
||||
for (j = start; j < max; j += repeat) {
|
||||
breakArrayT.push({
|
||||
value: j,
|
||||
move: 'in'
|
||||
});
|
||||
breakArrayT.push({
|
||||
value: j + (brk.to - brk.from),
|
||||
move: 'out',
|
||||
size: brk.breakSize
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
breakArrayT.sort(function(a, b) {
|
||||
var ret;
|
||||
if (a.value === b.value) {
|
||||
ret = (a.move === 'in' ? 0 : 1) - (b.move === 'in' ? 0 : 1);
|
||||
} else {
|
||||
ret = a.value - b.value;
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
|
||||
// Simplify the breaks
|
||||
inBrk = 0;
|
||||
start = min;
|
||||
|
||||
for (i in breakArrayT) {
|
||||
brk = breakArrayT[i];
|
||||
inBrk += (brk.move === 'in' ? 1 : -1);
|
||||
|
||||
if (inBrk === 1 && brk.move === 'in') {
|
||||
start = brk.value;
|
||||
}
|
||||
if (inBrk === 0) {
|
||||
breakArray.push({
|
||||
from: start,
|
||||
to: brk.value,
|
||||
len: brk.value - start - (brk.size || 0)
|
||||
});
|
||||
length += brk.value - start - (brk.size || 0);
|
||||
}
|
||||
}
|
||||
|
||||
axis.breakArray = breakArray;
|
||||
|
||||
fireEvent(axis, 'afterBreaks');
|
||||
|
||||
axis.transA *= ((max - axis.min) / (max - min - length));
|
||||
|
||||
axis.min = min;
|
||||
axis.max = max;
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
wrap(Series.prototype, 'generatePoints', function(proceed) {
|
||||
|
||||
proceed.apply(this, stripArguments(arguments));
|
||||
|
||||
var series = this,
|
||||
xAxis = series.xAxis,
|
||||
yAxis = series.yAxis,
|
||||
points = series.points,
|
||||
point,
|
||||
i = points.length,
|
||||
connectNulls = series.options.connectNulls,
|
||||
nullGap;
|
||||
|
||||
|
||||
if (xAxis && yAxis && (xAxis.options.breaks || yAxis.options.breaks)) {
|
||||
while (i--) {
|
||||
point = points[i];
|
||||
|
||||
nullGap = point.y === null && connectNulls === false; // respect nulls inside the break (#4275)
|
||||
if (!nullGap && (xAxis.isInAnyBreak(point.x, true) || yAxis.isInAnyBreak(point.y, true))) {
|
||||
points.splice(i, 1);
|
||||
if (this.data[i]) {
|
||||
this.data[i].destroyElements(); // removes the graphics for this point if they exist
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function drawPointsWrapped(proceed) {
|
||||
proceed.apply(this);
|
||||
this.drawBreaks(this.xAxis, ['x']);
|
||||
this.drawBreaks(this.yAxis, pick(this.pointArrayMap, ['y']));
|
||||
}
|
||||
|
||||
H.Series.prototype.drawBreaks = function(axis, keys) {
|
||||
var series = this,
|
||||
points = series.points,
|
||||
breaks,
|
||||
threshold,
|
||||
eventName,
|
||||
y;
|
||||
|
||||
each(keys, function(key) {
|
||||
breaks = axis.breakArray || [];
|
||||
threshold = axis.isXAxis ? axis.min : pick(series.options.threshold, axis.min);
|
||||
each(points, function(point) {
|
||||
y = pick(point['stack' + key.toUpperCase()], point[key]);
|
||||
each(breaks, function(brk) {
|
||||
eventName = false;
|
||||
|
||||
if ((threshold < brk.from && y > brk.to) || (threshold > brk.from && y < brk.from)) {
|
||||
eventName = 'pointBreak';
|
||||
} else if ((threshold < brk.from && y > brk.from && y < brk.to) || (threshold > brk.from && y > brk.to && y < brk.from)) { // point falls inside the break
|
||||
eventName = 'pointInBreak';
|
||||
}
|
||||
if (eventName) {
|
||||
fireEvent(axis, eventName, {
|
||||
point: point,
|
||||
brk: brk
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
wrap(H.seriesTypes.column.prototype, 'drawPoints', drawPointsWrapped);
|
||||
wrap(H.Series.prototype, 'drawPoints', drawPointsWrapped);
|
||||
|
||||
}(Highcharts));
|
||||
}));
|
26
assets/plugin/chart/highcharts/code/js/modules/data.js
Executable file
26
assets/plugin/chart/highcharts/code/js/modules/data.js
Executable file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
Highcharts JS v5.0.2 (2016-10-26)
|
||||
Data module
|
||||
|
||||
(c) 2012-2016 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(g){var p=g.win.document,m=g.each,z=g.pick,w=g.inArray,x=g.isNumber,A=g.splat,n,u=function(b,a){this.init(b,a)};g.extend(u.prototype,{init:function(b,a){this.options=b;this.chartOptions=a;this.columns=b.columns||this.rowsToColumns(b.rows)||[];this.firstRowAsNames=z(b.firstRowAsNames,!0);this.decimalRegex=b.decimalPoint&&new RegExp("^(-?[0-9]+)"+b.decimalPoint+"([0-9]+)$");this.rawColumns=[];
|
||||
this.columns.length?this.dataFound():(this.parseCSV(),this.parseTable(),this.parseGoogleSpreadsheet())},getColumnDistribution:function(){var b=this.chartOptions,a=this.options,d=[],f=function(b){return(g.seriesTypes[b||"line"].prototype.pointArrayMap||[0]).length},e=b&&b.chart&&b.chart.type,c=[],k=[],t=0,h;m(b&&b.series||[],function(b){c.push(f(b.type||e))});m(a&&a.seriesMapping||[],function(b){d.push(b.x||0)});0===d.length&&d.push(0);m(a&&a.seriesMapping||[],function(a){var d=new n,r,v=c[t]||f(e),
|
||||
q=g.seriesTypes[((b&&b.series||[])[t]||{}).type||e||"line"].prototype.pointArrayMap||["y"];d.addColumnReader(a.x,"x");for(r in a)a.hasOwnProperty(r)&&"x"!==r&&d.addColumnReader(a[r],r);for(h=0;h<v;h++)d.hasReader(q[h])||d.addColumnReader(void 0,q[h]);k.push(d);t++});a=g.seriesTypes[e||"line"].prototype.pointArrayMap;void 0===a&&(a=["y"]);this.valueCount={global:f(e),xColumns:d,individual:c,seriesBuilders:k,globalPointArrayMap:a}},dataFound:function(){this.options.switchRowsAndColumns&&(this.columns=
|
||||
this.rowsToColumns(this.columns));this.getColumnDistribution();this.parseTypes();!1!==this.parsed()&&this.complete()},parseCSV:function(){var b=this,a=this.options,d=a.csv,f=this.columns,e=a.startRow||0,c=a.endRow||Number.MAX_VALUE,k=a.startColumn||0,t=a.endColumn||Number.MAX_VALUE,h,g,y=0;d&&(g=d.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split(a.lineDelimiter||"\n"),h=a.itemDelimiter||(-1!==d.indexOf("\t")?"\t":","),m(g,function(a,d){var g=b.trim(a),r=0===g.indexOf("#");d>=e&&d<=c&&!r&&""!==g&&(a=
|
||||
a.split(h),m(a,function(b,a){a>=k&&a<=t&&(f[a-k]||(f[a-k]=[]),f[a-k][y]=b)}),y+=1)}),this.dataFound())},parseTable:function(){var b=this.options,a=b.table,d=this.columns,f=b.startRow||0,e=b.endRow||Number.MAX_VALUE,c=b.startColumn||0,k=b.endColumn||Number.MAX_VALUE;a&&("string"===typeof a&&(a=p.getElementById(a)),m(a.getElementsByTagName("tr"),function(b,a){a>=f&&a<=e&&m(b.children,function(b,e){("TD"===b.tagName||"TH"===b.tagName)&&e>=c&&e<=k&&(d[e-c]||(d[e-c]=[]),d[e-c][a-f]=b.innerHTML)})}),this.dataFound())},
|
||||
parseGoogleSpreadsheet:function(){var b=this,a=this.options,d=a.googleSpreadsheetKey,f=this.columns,e=a.startRow||0,c=a.endRow||Number.MAX_VALUE,k=a.startColumn||0,g=a.endColumn||Number.MAX_VALUE,h,v;d&&jQuery.ajax({dataType:"json",url:"https://spreadsheets.google.com/feeds/cells/"+d+"/"+(a.googleSpreadsheetWorksheet||"od6")+"/public/values?alt\x3djson-in-script\x26callback\x3d?",error:a.error,success:function(a){a=a.feed.entry;var d,t=a.length,q=0,n=0,l;for(l=0;l<t;l++)d=a[l],q=Math.max(q,d.gs$cell.col),
|
||||
n=Math.max(n,d.gs$cell.row);for(l=0;l<q;l++)l>=k&&l<=g&&(f[l-k]=[],f[l-k].length=Math.min(n,c-e));for(l=0;l<t;l++)d=a[l],h=d.gs$cell.row-1,v=d.gs$cell.col-1,v>=k&&v<=g&&h>=e&&h<=c&&(f[v-k][h-e]=d.content.$t);m(f,function(a){for(l=0;l<a.length;l++)void 0===a[l]&&(a[l]=null)});b.dataFound()}})},trim:function(b,a){"string"===typeof b&&(b=b.replace(/^\s+|\s+$/g,""),a&&/^[0-9\s]+$/.test(b)&&(b=b.replace(/\s/g,"")),this.decimalRegex&&(b=b.replace(this.decimalRegex,"$1.$2")));return b},parseTypes:function(){for(var b=
|
||||
this.columns,a=b.length;a--;)this.parseColumn(b[a],a)},parseColumn:function(b,a){var d=this.rawColumns,f=this.columns,e=b.length,c,k,g,h,n=this.firstRowAsNames,m=-1!==w(a,this.valueCount.xColumns),r=[],p=this.chartOptions,q,u=(this.options.columnTypes||[])[a],p=m&&(p&&p.xAxis&&"category"===A(p.xAxis)[0].type||"string"===u);for(d[a]||(d[a]=[]);e--;)c=r[e]||b[e],g=this.trim(c),h=this.trim(c,!0),k=parseFloat(h),void 0===d[a][e]&&(d[a][e]=g),p||0===e&&n?b[e]=g:+h===k?(b[e]=k,31536E6<k&&"float"!==u?b.isDatetime=
|
||||
!0:b.isNumeric=!0,void 0!==b[e+1]&&(q=k>b[e+1])):(k=this.parseDate(c),m&&x(k)&&"float"!==u?(r[e]=c,b[e]=k,b.isDatetime=!0,void 0!==b[e+1]&&(c=k>b[e+1],c!==q&&void 0!==q&&(this.alternativeFormat?(this.dateFormat=this.alternativeFormat,e=b.length,this.alternativeFormat=this.dateFormats[this.dateFormat].alternative):b.unsorted=!0),q=c)):(b[e]=""===g?null:g,0!==e&&(b.isDatetime||b.isNumeric)&&(b.mixed=!0)));m&&b.mixed&&(f[a]=d[a]);if(m&&q&&this.options.sort)for(a=0;a<f.length;a++)f[a].reverse(),n&&f[a].unshift(f[a].pop())},
|
||||
dateFormats:{"YYYY-mm-dd":{regex:/^([0-9]{4})[\-\/\.]([0-9]{2})[\-\/\.]([0-9]{2})$/,parser:function(b){return Date.UTC(+b[1],b[2]-1,+b[3])}},"dd/mm/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(b){return Date.UTC(+b[3],b[2]-1,+b[1])},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(b){return Date.UTC(+b[3],b[1]-1,+b[2])}},"dd/mm/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
|
||||
parser:function(b){return Date.UTC(+b[3]+2E3,b[2]-1,+b[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,parser:function(b){return Date.UTC(+b[3]+2E3,b[1]-1,+b[2])}}},parseDate:function(b){var a=this.options.parseDate,d,f,e=this.options.dateFormat||this.dateFormat,c;if(a)d=a(b);else if("string"===typeof b){if(e)a=this.dateFormats[e],(c=b.match(a.regex))&&(d=a.parser(c));else for(f in this.dateFormats)if(a=this.dateFormats[f],c=b.match(a.regex)){this.dateFormat=
|
||||
f;this.alternativeFormat=a.alternative;d=a.parser(c);break}c||(c=Date.parse(b),"object"===typeof c&&null!==c&&c.getTime?d=c.getTime()-6E4*c.getTimezoneOffset():x(c)&&(d=c-6E4*(new Date(c)).getTimezoneOffset()))}return d},rowsToColumns:function(b){var a,d,f,e,c;if(b)for(c=[],d=b.length,a=0;a<d;a++)for(e=b[a].length,f=0;f<e;f++)c[f]||(c[f]=[]),c[f][a]=b[a][f];return c},parsed:function(){if(this.options.parsed)return this.options.parsed.call(this,this.columns)},getFreeIndexes:function(b,a){var d,f=[],
|
||||
e=[],c;for(d=0;d<b;d+=1)f.push(!0);for(b=0;b<a.length;b+=1)for(c=a[b].getReferencedColumnIndexes(),d=0;d<c.length;d+=1)f[c[d]]=!1;for(d=0;d<f.length;d+=1)f[d]&&e.push(d);return e},complete:function(){var b=this.columns,a,d=this.options,f,e,c,k,g=[],h;if(d.complete||d.afterComplete){for(c=0;c<b.length;c++)this.firstRowAsNames&&(b[c].name=b[c].shift());f=[];e=this.getFreeIndexes(b.length,this.valueCount.seriesBuilders);for(c=0;c<this.valueCount.seriesBuilders.length;c++)h=this.valueCount.seriesBuilders[c],
|
||||
h.populateColumns(e)&&g.push(h);for(;0<e.length;){h=new n;h.addColumnReader(0,"x");c=w(0,e);-1!==c&&e.splice(c,1);for(c=0;c<this.valueCount.global;c++)h.addColumnReader(void 0,this.valueCount.globalPointArrayMap[c]);h.populateColumns(e)&&g.push(h)}0<g.length&&0<g[0].readers.length&&(h=b[g[0].readers[0].columnIndex],void 0!==h&&(h.isDatetime?a="datetime":h.isNumeric||(a="category")));if("category"===a)for(c=0;c<g.length;c++)for(h=g[c],e=0;e<h.readers.length;e++)"x"===h.readers[e].configName&&(h.readers[e].configName=
|
||||
"name");for(c=0;c<g.length;c++){h=g[c];e=[];for(k=0;k<b[0].length;k++)e[k]=h.read(b,k);f[c]={data:e};h.name&&(f[c].name=h.name);"category"===a&&(f[c].turboThreshold=0)}b={series:f};a&&(b.xAxis={type:a},"category"===a&&(b.xAxis.uniqueNames=!1));d.complete&&d.complete(b);d.afterComplete&&d.afterComplete(b)}}});g.Data=u;g.data=function(b,a){return new u(b,a)};g.wrap(g.Chart.prototype,"init",function(b,a,d){var f=this;a&&a.data?g.data(g.extend(a.data,{afterComplete:function(e){var c,k;if(a.hasOwnProperty("series"))if("object"===
|
||||
typeof a.series)for(c=Math.max(a.series.length,e.series.length);c--;)k=a.series[c]||{},a.series[c]=g.merge(k,e.series[c]);else delete a.series;a=g.merge(e,a);b.call(f,a,d)}}),a):b.call(f,a,d)});n=function(){this.readers=[];this.pointIsArray=!0};n.prototype.populateColumns=function(b){var a=!0;m(this.readers,function(a){void 0===a.columnIndex&&(a.columnIndex=b.shift())});m(this.readers,function(b){void 0===b.columnIndex&&(a=!1)});return a};n.prototype.read=function(b,a){var d=this.pointIsArray,f=d?
|
||||
[]:{},e;m(this.readers,function(c){var e=b[c.columnIndex][a];d?f.push(e):f[c.configName]=e});void 0===this.name&&2<=this.readers.length&&(e=this.getReferencedColumnIndexes(),2<=e.length&&(e.shift(),e.sort(),this.name=b[e.shift()].name));return f};n.prototype.addColumnReader=function(b,a){this.readers.push({columnIndex:b,configName:a});"x"!==a&&"y"!==a&&void 0!==a&&(this.pointIsArray=!1)};n.prototype.getReferencedColumnIndexes=function(){var b,a=[],d;for(b=0;b<this.readers.length;b+=1)d=this.readers[b],
|
||||
void 0!==d.columnIndex&&a.push(d.columnIndex);return a};n.prototype.hasReader=function(b){var a,d;for(a=0;a<this.readers.length;a+=1)if(d=this.readers[a],d.configName===b)return!0}})(p)});
|
981
assets/plugin/chart/highcharts/code/js/modules/data.src.js
Executable file
981
assets/plugin/chart/highcharts/code/js/modules/data.src.js
Executable file
@ -0,0 +1,981 @@
|
||||
/**
|
||||
* @license Highcharts JS v5.0.2 (2016-10-26)
|
||||
* Data module
|
||||
*
|
||||
* (c) 2012-2016 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
(function(factory) {
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
module.exports = factory;
|
||||
} else {
|
||||
factory(Highcharts);
|
||||
}
|
||||
}(function(Highcharts) {
|
||||
(function(Highcharts) {
|
||||
/**
|
||||
* Data module
|
||||
*
|
||||
* (c) 2012-2016 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
|
||||
/* global jQuery */
|
||||
'use strict';
|
||||
|
||||
// Utilities
|
||||
var win = Highcharts.win,
|
||||
doc = win.document,
|
||||
each = Highcharts.each,
|
||||
pick = Highcharts.pick,
|
||||
inArray = Highcharts.inArray,
|
||||
isNumber = Highcharts.isNumber,
|
||||
splat = Highcharts.splat,
|
||||
SeriesBuilder;
|
||||
|
||||
|
||||
// The Data constructor
|
||||
var Data = function(dataOptions, chartOptions) {
|
||||
this.init(dataOptions, chartOptions);
|
||||
};
|
||||
|
||||
// Set the prototype properties
|
||||
Highcharts.extend(Data.prototype, {
|
||||
|
||||
/**
|
||||
* Initialize the Data object with the given options
|
||||
*/
|
||||
init: function(options, chartOptions) {
|
||||
this.options = options;
|
||||
this.chartOptions = chartOptions;
|
||||
this.columns = options.columns || this.rowsToColumns(options.rows) || [];
|
||||
this.firstRowAsNames = pick(options.firstRowAsNames, true);
|
||||
this.decimalRegex = options.decimalPoint && new RegExp('^(-?[0-9]+)' + options.decimalPoint + '([0-9]+)$');
|
||||
|
||||
// This is a two-dimensional array holding the raw, trimmed string values
|
||||
// with the same organisation as the columns array. It makes it possible
|
||||
// for example to revert from interpreted timestamps to string-based
|
||||
// categories.
|
||||
this.rawColumns = [];
|
||||
|
||||
// No need to parse or interpret anything
|
||||
if (this.columns.length) {
|
||||
this.dataFound();
|
||||
|
||||
// Parse and interpret
|
||||
} else {
|
||||
|
||||
// Parse a CSV string if options.csv is given
|
||||
this.parseCSV();
|
||||
|
||||
// Parse a HTML table if options.table is given
|
||||
this.parseTable();
|
||||
|
||||
// Parse a Google Spreadsheet
|
||||
this.parseGoogleSpreadsheet();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the column distribution. For example, a line series takes a single column for
|
||||
* Y values. A range series takes two columns for low and high values respectively,
|
||||
* and an OHLC series takes four columns.
|
||||
*/
|
||||
getColumnDistribution: function() {
|
||||
var chartOptions = this.chartOptions,
|
||||
options = this.options,
|
||||
xColumns = [],
|
||||
getValueCount = function(type) {
|
||||
return (Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap || [0]).length;
|
||||
},
|
||||
getPointArrayMap = function(type) {
|
||||
return Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap;
|
||||
},
|
||||
globalType = chartOptions && chartOptions.chart && chartOptions.chart.type,
|
||||
individualCounts = [],
|
||||
seriesBuilders = [],
|
||||
seriesIndex = 0,
|
||||
i;
|
||||
|
||||
each((chartOptions && chartOptions.series) || [], function(series) {
|
||||
individualCounts.push(getValueCount(series.type || globalType));
|
||||
});
|
||||
|
||||
// Collect the x-column indexes from seriesMapping
|
||||
each((options && options.seriesMapping) || [], function(mapping) {
|
||||
xColumns.push(mapping.x || 0);
|
||||
});
|
||||
|
||||
// If there are no defined series with x-columns, use the first column as x column
|
||||
if (xColumns.length === 0) {
|
||||
xColumns.push(0);
|
||||
}
|
||||
|
||||
// Loop all seriesMappings and constructs SeriesBuilders from
|
||||
// the mapping options.
|
||||
each((options && options.seriesMapping) || [], function(mapping) {
|
||||
var builder = new SeriesBuilder(),
|
||||
name,
|
||||
numberOfValueColumnsNeeded = individualCounts[seriesIndex] || getValueCount(globalType),
|
||||
seriesArr = (chartOptions && chartOptions.series) || [],
|
||||
series = seriesArr[seriesIndex] || {},
|
||||
pointArrayMap = getPointArrayMap(series.type || globalType) || ['y'];
|
||||
|
||||
// Add an x reader from the x property or from an undefined column
|
||||
// if the property is not set. It will then be auto populated later.
|
||||
builder.addColumnReader(mapping.x, 'x');
|
||||
|
||||
// Add all column mappings
|
||||
for (name in mapping) {
|
||||
if (mapping.hasOwnProperty(name) && name !== 'x') {
|
||||
builder.addColumnReader(mapping[name], name);
|
||||
}
|
||||
}
|
||||
|
||||
// Add missing columns
|
||||
for (i = 0; i < numberOfValueColumnsNeeded; i++) {
|
||||
if (!builder.hasReader(pointArrayMap[i])) {
|
||||
//builder.addNextColumnReader(pointArrayMap[i]);
|
||||
// Create and add a column reader for the next free column index
|
||||
builder.addColumnReader(undefined, pointArrayMap[i]);
|
||||
}
|
||||
}
|
||||
|
||||
seriesBuilders.push(builder);
|
||||
seriesIndex++;
|
||||
});
|
||||
|
||||
var globalPointArrayMap = getPointArrayMap(globalType);
|
||||
if (globalPointArrayMap === undefined) {
|
||||
globalPointArrayMap = ['y'];
|
||||
}
|
||||
|
||||
this.valueCount = {
|
||||
global: getValueCount(globalType),
|
||||
xColumns: xColumns,
|
||||
individual: individualCounts,
|
||||
seriesBuilders: seriesBuilders,
|
||||
globalPointArrayMap: globalPointArrayMap
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* When the data is parsed into columns, either by CSV, table, GS or direct input,
|
||||
* continue with other operations.
|
||||
*/
|
||||
dataFound: function() {
|
||||
|
||||
if (this.options.switchRowsAndColumns) {
|
||||
this.columns = this.rowsToColumns(this.columns);
|
||||
}
|
||||
|
||||
// Interpret the info about series and columns
|
||||
this.getColumnDistribution();
|
||||
|
||||
// Interpret the values into right types
|
||||
this.parseTypes();
|
||||
|
||||
// Handle columns if a handleColumns callback is given
|
||||
if (this.parsed() !== false) {
|
||||
|
||||
// Complete if a complete callback is given
|
||||
this.complete();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Parse a CSV input string
|
||||
*/
|
||||
parseCSV: function() {
|
||||
var self = this,
|
||||
options = this.options,
|
||||
csv = options.csv,
|
||||
columns = this.columns,
|
||||
startRow = options.startRow || 0,
|
||||
endRow = options.endRow || Number.MAX_VALUE,
|
||||
startColumn = options.startColumn || 0,
|
||||
endColumn = options.endColumn || Number.MAX_VALUE,
|
||||
itemDelimiter,
|
||||
lines,
|
||||
activeRowNo = 0;
|
||||
|
||||
if (csv) {
|
||||
|
||||
lines = csv
|
||||
.replace(/\r\n/g, '\n') // Unix
|
||||
.replace(/\r/g, '\n') // Mac
|
||||
.split(options.lineDelimiter || '\n');
|
||||
|
||||
itemDelimiter = options.itemDelimiter || (csv.indexOf('\t') !== -1 ? '\t' : ',');
|
||||
|
||||
each(lines, function(line, rowNo) {
|
||||
var trimmed = self.trim(line),
|
||||
isComment = trimmed.indexOf('#') === 0,
|
||||
isBlank = trimmed === '',
|
||||
items;
|
||||
|
||||
if (rowNo >= startRow && rowNo <= endRow && !isComment && !isBlank) {
|
||||
items = line.split(itemDelimiter);
|
||||
each(items, function(item, colNo) {
|
||||
if (colNo >= startColumn && colNo <= endColumn) {
|
||||
if (!columns[colNo - startColumn]) {
|
||||
columns[colNo - startColumn] = [];
|
||||
}
|
||||
|
||||
columns[colNo - startColumn][activeRowNo] = item;
|
||||
}
|
||||
});
|
||||
activeRowNo += 1;
|
||||
}
|
||||
});
|
||||
|
||||
this.dataFound();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Parse a HTML table
|
||||
*/
|
||||
parseTable: function() {
|
||||
var options = this.options,
|
||||
table = options.table,
|
||||
columns = this.columns,
|
||||
startRow = options.startRow || 0,
|
||||
endRow = options.endRow || Number.MAX_VALUE,
|
||||
startColumn = options.startColumn || 0,
|
||||
endColumn = options.endColumn || Number.MAX_VALUE;
|
||||
|
||||
if (table) {
|
||||
|
||||
if (typeof table === 'string') {
|
||||
table = doc.getElementById(table);
|
||||
}
|
||||
|
||||
each(table.getElementsByTagName('tr'), function(tr, rowNo) {
|
||||
if (rowNo >= startRow && rowNo <= endRow) {
|
||||
each(tr.children, function(item, colNo) {
|
||||
if ((item.tagName === 'TD' || item.tagName === 'TH') && colNo >= startColumn && colNo <= endColumn) {
|
||||
if (!columns[colNo - startColumn]) {
|
||||
columns[colNo - startColumn] = [];
|
||||
}
|
||||
|
||||
columns[colNo - startColumn][rowNo - startRow] = item.innerHTML;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.dataFound(); // continue
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
*/
|
||||
parseGoogleSpreadsheet: function() {
|
||||
var self = this,
|
||||
options = this.options,
|
||||
googleSpreadsheetKey = options.googleSpreadsheetKey,
|
||||
columns = this.columns,
|
||||
startRow = options.startRow || 0,
|
||||
endRow = options.endRow || Number.MAX_VALUE,
|
||||
startColumn = options.startColumn || 0,
|
||||
endColumn = options.endColumn || Number.MAX_VALUE,
|
||||
gr, // google row
|
||||
gc; // google column
|
||||
|
||||
if (googleSpreadsheetKey) {
|
||||
jQuery.ajax({
|
||||
dataType: 'json',
|
||||
url: 'https://spreadsheets.google.com/feeds/cells/' +
|
||||
googleSpreadsheetKey + '/' + (options.googleSpreadsheetWorksheet || 'od6') +
|
||||
'/public/values?alt=json-in-script&callback=?',
|
||||
error: options.error,
|
||||
success: function(json) {
|
||||
// Prepare the data from the spreadsheat
|
||||
var cells = json.feed.entry,
|
||||
cell,
|
||||
cellCount = cells.length,
|
||||
colCount = 0,
|
||||
rowCount = 0,
|
||||
i;
|
||||
|
||||
// First, find the total number of columns and rows that
|
||||
// are actually filled with data
|
||||
for (i = 0; i < cellCount; i++) {
|
||||
cell = cells[i];
|
||||
colCount = Math.max(colCount, cell.gs$cell.col);
|
||||
rowCount = Math.max(rowCount, cell.gs$cell.row);
|
||||
}
|
||||
|
||||
// Set up arrays containing the column data
|
||||
for (i = 0; i < colCount; i++) {
|
||||
if (i >= startColumn && i <= endColumn) {
|
||||
// Create new columns with the length of either end-start or rowCount
|
||||
columns[i - startColumn] = [];
|
||||
|
||||
// Setting the length to avoid jslint warning
|
||||
columns[i - startColumn].length = Math.min(rowCount, endRow - startRow);
|
||||
}
|
||||
}
|
||||
|
||||
// Loop over the cells and assign the value to the right
|
||||
// place in the column arrays
|
||||
for (i = 0; i < cellCount; i++) {
|
||||
cell = cells[i];
|
||||
gr = cell.gs$cell.row - 1; // rows start at 1
|
||||
gc = cell.gs$cell.col - 1; // columns start at 1
|
||||
|
||||
// If both row and col falls inside start and end
|
||||
// set the transposed cell value in the newly created columns
|
||||
if (gc >= startColumn && gc <= endColumn &&
|
||||
gr >= startRow && gr <= endRow) {
|
||||
columns[gc - startColumn][gr - startRow] = cell.content.$t;
|
||||
}
|
||||
}
|
||||
|
||||
// Insert null for empty spreadsheet cells (#5298)
|
||||
each(columns, function(column) {
|
||||
for (i = 0; i < column.length; i++) {
|
||||
if (column[i] === undefined) {
|
||||
column[i] = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
self.dataFound();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Trim a string from whitespace
|
||||
*/
|
||||
trim: function(str, inside) {
|
||||
if (typeof str === 'string') {
|
||||
str = str.replace(/^\s+|\s+$/g, '');
|
||||
|
||||
// Clear white space insdie the string, like thousands separators
|
||||
if (inside && /^[0-9\s]+$/.test(str)) {
|
||||
str = str.replace(/\s/g, '');
|
||||
}
|
||||
|
||||
if (this.decimalRegex) {
|
||||
str = str.replace(this.decimalRegex, '$1.$2');
|
||||
}
|
||||
}
|
||||
return str;
|
||||
},
|
||||
|
||||
/**
|
||||
* Parse numeric cells in to number types and date types in to true dates.
|
||||
*/
|
||||
parseTypes: function() {
|
||||
var columns = this.columns,
|
||||
col = columns.length;
|
||||
|
||||
while (col--) {
|
||||
this.parseColumn(columns[col], col);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Parse a single column. Set properties like .isDatetime and .isNumeric.
|
||||
*/
|
||||
parseColumn: function(column, col) {
|
||||
var rawColumns = this.rawColumns,
|
||||
columns = this.columns,
|
||||
row = column.length,
|
||||
val,
|
||||
floatVal,
|
||||
trimVal,
|
||||
trimInsideVal,
|
||||
firstRowAsNames = this.firstRowAsNames,
|
||||
isXColumn = inArray(col, this.valueCount.xColumns) !== -1,
|
||||
dateVal,
|
||||
backup = [],
|
||||
diff,
|
||||
chartOptions = this.chartOptions,
|
||||
descending,
|
||||
columnTypes = this.options.columnTypes || [],
|
||||
columnType = columnTypes[col],
|
||||
forceCategory = isXColumn && ((chartOptions && chartOptions.xAxis && splat(chartOptions.xAxis)[0].type === 'category') || columnType === 'string');
|
||||
|
||||
if (!rawColumns[col]) {
|
||||
rawColumns[col] = [];
|
||||
}
|
||||
while (row--) {
|
||||
val = backup[row] || column[row];
|
||||
|
||||
trimVal = this.trim(val);
|
||||
trimInsideVal = this.trim(val, true);
|
||||
floatVal = parseFloat(trimInsideVal);
|
||||
|
||||
// Set it the first time
|
||||
if (rawColumns[col][row] === undefined) {
|
||||
rawColumns[col][row] = trimVal;
|
||||
}
|
||||
|
||||
// Disable number or date parsing by setting the X axis type to category
|
||||
if (forceCategory || (row === 0 && firstRowAsNames)) {
|
||||
column[row] = trimVal;
|
||||
|
||||
} else if (+trimInsideVal === floatVal) { // is numeric
|
||||
|
||||
column[row] = floatVal;
|
||||
|
||||
// If the number is greater than milliseconds in a year, assume datetime
|
||||
if (floatVal > 365 * 24 * 3600 * 1000 && columnType !== 'float') {
|
||||
column.isDatetime = true;
|
||||
} else {
|
||||
column.isNumeric = true;
|
||||
}
|
||||
|
||||
if (column[row + 1] !== undefined) {
|
||||
descending = floatVal > column[row + 1];
|
||||
}
|
||||
|
||||
// String, continue to determine if it is a date string or really a string
|
||||
} else {
|
||||
dateVal = this.parseDate(val);
|
||||
// Only allow parsing of dates if this column is an x-column
|
||||
if (isXColumn && isNumber(dateVal) && columnType !== 'float') { // is date
|
||||
backup[row] = val;
|
||||
column[row] = dateVal;
|
||||
column.isDatetime = true;
|
||||
|
||||
// Check if the dates are uniformly descending or ascending. If they
|
||||
// are not, chances are that they are a different time format, so check
|
||||
// for alternative.
|
||||
if (column[row + 1] !== undefined) {
|
||||
diff = dateVal > column[row + 1];
|
||||
if (diff !== descending && descending !== undefined) {
|
||||
if (this.alternativeFormat) {
|
||||
this.dateFormat = this.alternativeFormat;
|
||||
row = column.length;
|
||||
this.alternativeFormat = this.dateFormats[this.dateFormat].alternative;
|
||||
} else {
|
||||
column.unsorted = true;
|
||||
}
|
||||
}
|
||||
descending = diff;
|
||||
}
|
||||
|
||||
} else { // string
|
||||
column[row] = trimVal === '' ? null : trimVal;
|
||||
if (row !== 0 && (column.isDatetime || column.isNumeric)) {
|
||||
column.mixed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If strings are intermixed with numbers or dates in a parsed column, it is an indication
|
||||
// that parsing went wrong or the data was not intended to display as numbers or dates and
|
||||
// parsing is too aggressive. Fall back to categories. Demonstrated in the
|
||||
// highcharts/demo/column-drilldown sample.
|
||||
if (isXColumn && column.mixed) {
|
||||
columns[col] = rawColumns[col];
|
||||
}
|
||||
|
||||
// If the 0 column is date or number and descending, reverse all columns.
|
||||
if (isXColumn && descending && this.options.sort) {
|
||||
for (col = 0; col < columns.length; col++) {
|
||||
columns[col].reverse();
|
||||
if (firstRowAsNames) {
|
||||
columns[col].unshift(columns[col].pop());
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* A collection of available date formats, extendable from the outside to support
|
||||
* custom date formats.
|
||||
*/
|
||||
dateFormats: {
|
||||
'YYYY-mm-dd': {
|
||||
regex: /^([0-9]{4})[\-\/\.]([0-9]{2})[\-\/\.]([0-9]{2})$/,
|
||||
parser: function(match) {
|
||||
return Date.UTC(+match[1], match[2] - 1, +match[3]);
|
||||
}
|
||||
},
|
||||
'dd/mm/YYYY': {
|
||||
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,
|
||||
parser: function(match) {
|
||||
return Date.UTC(+match[3], match[2] - 1, +match[1]);
|
||||
},
|
||||
alternative: 'mm/dd/YYYY' // different format with the same regex
|
||||
},
|
||||
'mm/dd/YYYY': {
|
||||
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,
|
||||
parser: function(match) {
|
||||
return Date.UTC(+match[3], match[1] - 1, +match[2]);
|
||||
}
|
||||
},
|
||||
'dd/mm/YY': {
|
||||
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
|
||||
parser: function(match) {
|
||||
return Date.UTC(+match[3] + 2000, match[2] - 1, +match[1]);
|
||||
},
|
||||
alternative: 'mm/dd/YY' // different format with the same regex
|
||||
},
|
||||
'mm/dd/YY': {
|
||||
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
|
||||
parser: function(match) {
|
||||
return Date.UTC(+match[3] + 2000, match[1] - 1, +match[2]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Parse a date and return it as a number. Overridable through options.parseDate.
|
||||
*/
|
||||
parseDate: function(val) {
|
||||
var parseDate = this.options.parseDate,
|
||||
ret,
|
||||
key,
|
||||
format,
|
||||
dateFormat = this.options.dateFormat || this.dateFormat,
|
||||
match;
|
||||
|
||||
if (parseDate) {
|
||||
ret = parseDate(val);
|
||||
|
||||
} else if (typeof val === 'string') {
|
||||
// Auto-detect the date format the first time
|
||||
if (!dateFormat) {
|
||||
for (key in this.dateFormats) {
|
||||
format = this.dateFormats[key];
|
||||
match = val.match(format.regex);
|
||||
if (match) {
|
||||
this.dateFormat = dateFormat = key;
|
||||
this.alternativeFormat = format.alternative;
|
||||
ret = format.parser(match);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Next time, use the one previously found
|
||||
} else {
|
||||
format = this.dateFormats[dateFormat];
|
||||
match = val.match(format.regex);
|
||||
if (match) {
|
||||
ret = format.parser(match);
|
||||
}
|
||||
}
|
||||
// Fall back to Date.parse
|
||||
if (!match) {
|
||||
match = Date.parse(val);
|
||||
// External tools like Date.js and MooTools extend Date object and
|
||||
// returns a date.
|
||||
if (typeof match === 'object' && match !== null && match.getTime) {
|
||||
ret = match.getTime() - match.getTimezoneOffset() * 60000;
|
||||
|
||||
// Timestamp
|
||||
} else if (isNumber(match)) {
|
||||
ret = match - (new Date(match)).getTimezoneOffset() * 60000;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
|
||||
/**
|
||||
* Reorganize rows into columns
|
||||
*/
|
||||
rowsToColumns: function(rows) {
|
||||
var row,
|
||||
rowsLength,
|
||||
col,
|
||||
colsLength,
|
||||
columns;
|
||||
|
||||
if (rows) {
|
||||
columns = [];
|
||||
rowsLength = rows.length;
|
||||
for (row = 0; row < rowsLength; row++) {
|
||||
colsLength = rows[row].length;
|
||||
for (col = 0; col < colsLength; col++) {
|
||||
if (!columns[col]) {
|
||||
columns[col] = [];
|
||||
}
|
||||
columns[col][row] = rows[row][col];
|
||||
}
|
||||
}
|
||||
}
|
||||
return columns;
|
||||
},
|
||||
|
||||
/**
|
||||
* A hook for working directly on the parsed columns
|
||||
*/
|
||||
parsed: function() {
|
||||
if (this.options.parsed) {
|
||||
return this.options.parsed.call(this, this.columns);
|
||||
}
|
||||
},
|
||||
|
||||
getFreeIndexes: function(numberOfColumns, seriesBuilders) {
|
||||
var s,
|
||||
i,
|
||||
freeIndexes = [],
|
||||
freeIndexValues = [],
|
||||
referencedIndexes;
|
||||
|
||||
// Add all columns as free
|
||||
for (i = 0; i < numberOfColumns; i = i + 1) {
|
||||
freeIndexes.push(true);
|
||||
}
|
||||
|
||||
// Loop all defined builders and remove their referenced columns
|
||||
for (s = 0; s < seriesBuilders.length; s = s + 1) {
|
||||
referencedIndexes = seriesBuilders[s].getReferencedColumnIndexes();
|
||||
|
||||
for (i = 0; i < referencedIndexes.length; i = i + 1) {
|
||||
freeIndexes[referencedIndexes[i]] = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Collect the values for the free indexes
|
||||
for (i = 0; i < freeIndexes.length; i = i + 1) {
|
||||
if (freeIndexes[i]) {
|
||||
freeIndexValues.push(i);
|
||||
}
|
||||
}
|
||||
|
||||
return freeIndexValues;
|
||||
},
|
||||
|
||||
/**
|
||||
* If a complete callback function is provided in the options, interpret the
|
||||
* columns into a Highcharts options object.
|
||||
*/
|
||||
complete: function() {
|
||||
|
||||
var columns = this.columns,
|
||||
xColumns = [],
|
||||
type,
|
||||
options = this.options,
|
||||
series,
|
||||
data,
|
||||
i,
|
||||
j,
|
||||
r,
|
||||
seriesIndex,
|
||||
chartOptions,
|
||||
allSeriesBuilders = [],
|
||||
builder,
|
||||
freeIndexes,
|
||||
typeCol,
|
||||
index;
|
||||
|
||||
xColumns.length = columns.length;
|
||||
if (options.complete || options.afterComplete) {
|
||||
|
||||
// Get the names and shift the top row
|
||||
for (i = 0; i < columns.length; i++) {
|
||||
if (this.firstRowAsNames) {
|
||||
columns[i].name = columns[i].shift();
|
||||
}
|
||||
}
|
||||
|
||||
// Use the next columns for series
|
||||
series = [];
|
||||
freeIndexes = this.getFreeIndexes(columns.length, this.valueCount.seriesBuilders);
|
||||
|
||||
// Populate defined series
|
||||
for (seriesIndex = 0; seriesIndex < this.valueCount.seriesBuilders.length; seriesIndex++) {
|
||||
builder = this.valueCount.seriesBuilders[seriesIndex];
|
||||
|
||||
// If the builder can be populated with remaining columns, then add it to allBuilders
|
||||
if (builder.populateColumns(freeIndexes)) {
|
||||
allSeriesBuilders.push(builder);
|
||||
}
|
||||
}
|
||||
|
||||
// Populate dynamic series
|
||||
while (freeIndexes.length > 0) {
|
||||
builder = new SeriesBuilder();
|
||||
builder.addColumnReader(0, 'x');
|
||||
|
||||
// Mark index as used (not free)
|
||||
index = inArray(0, freeIndexes);
|
||||
if (index !== -1) {
|
||||
freeIndexes.splice(index, 1);
|
||||
}
|
||||
|
||||
for (i = 0; i < this.valueCount.global; i++) {
|
||||
// Create and add a column reader for the next free column index
|
||||
builder.addColumnReader(undefined, this.valueCount.globalPointArrayMap[i]);
|
||||
}
|
||||
|
||||
// If the builder can be populated with remaining columns, then add it to allBuilders
|
||||
if (builder.populateColumns(freeIndexes)) {
|
||||
allSeriesBuilders.push(builder);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the data-type from the first series x column
|
||||
if (allSeriesBuilders.length > 0 && allSeriesBuilders[0].readers.length > 0) {
|
||||
typeCol = columns[allSeriesBuilders[0].readers[0].columnIndex];
|
||||
if (typeCol !== undefined) {
|
||||
if (typeCol.isDatetime) {
|
||||
type = 'datetime';
|
||||
} else if (!typeCol.isNumeric) {
|
||||
type = 'category';
|
||||
}
|
||||
}
|
||||
}
|
||||
// Axis type is category, then the "x" column should be called "name"
|
||||
if (type === 'category') {
|
||||
for (seriesIndex = 0; seriesIndex < allSeriesBuilders.length; seriesIndex++) {
|
||||
builder = allSeriesBuilders[seriesIndex];
|
||||
for (r = 0; r < builder.readers.length; r++) {
|
||||
if (builder.readers[r].configName === 'x') {
|
||||
builder.readers[r].configName = 'name';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Read data for all builders
|
||||
for (seriesIndex = 0; seriesIndex < allSeriesBuilders.length; seriesIndex++) {
|
||||
builder = allSeriesBuilders[seriesIndex];
|
||||
|
||||
// Iterate down the cells of each column and add data to the series
|
||||
data = [];
|
||||
for (j = 0; j < columns[0].length; j++) {
|
||||
data[j] = builder.read(columns, j);
|
||||
}
|
||||
|
||||
// Add the series
|
||||
series[seriesIndex] = {
|
||||
data: data
|
||||
};
|
||||
if (builder.name) {
|
||||
series[seriesIndex].name = builder.name;
|
||||
}
|
||||
if (type === 'category') {
|
||||
series[seriesIndex].turboThreshold = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Do the callback
|
||||
chartOptions = {
|
||||
series: series
|
||||
};
|
||||
if (type) {
|
||||
chartOptions.xAxis = {
|
||||
type: type
|
||||
};
|
||||
if (type === 'category') {
|
||||
chartOptions.xAxis.uniqueNames = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.complete) {
|
||||
options.complete(chartOptions);
|
||||
}
|
||||
|
||||
// The afterComplete hook is used internally to avoid conflict with the externally
|
||||
// available complete option.
|
||||
if (options.afterComplete) {
|
||||
options.afterComplete(chartOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Register the Data prototype and data function on Highcharts
|
||||
Highcharts.Data = Data;
|
||||
Highcharts.data = function(options, chartOptions) {
|
||||
return new Data(options, chartOptions);
|
||||
};
|
||||
|
||||
// Extend Chart.init so that the Chart constructor accepts a new configuration
|
||||
// option group, data.
|
||||
Highcharts.wrap(Highcharts.Chart.prototype, 'init', function(proceed, userOptions, callback) {
|
||||
var chart = this;
|
||||
|
||||
if (userOptions && userOptions.data) {
|
||||
Highcharts.data(Highcharts.extend(userOptions.data, {
|
||||
|
||||
afterComplete: function(dataOptions) {
|
||||
var i, series;
|
||||
|
||||
// Merge series configs
|
||||
if (userOptions.hasOwnProperty('series')) {
|
||||
if (typeof userOptions.series === 'object') {
|
||||
i = Math.max(userOptions.series.length, dataOptions.series.length);
|
||||
while (i--) {
|
||||
series = userOptions.series[i] || {};
|
||||
userOptions.series[i] = Highcharts.merge(series, dataOptions.series[i]);
|
||||
}
|
||||
} else { // Allow merging in dataOptions.series (#2856)
|
||||
delete userOptions.series;
|
||||
}
|
||||
}
|
||||
|
||||
// Do the merge
|
||||
userOptions = Highcharts.merge(dataOptions, userOptions);
|
||||
|
||||
proceed.call(chart, userOptions, callback);
|
||||
}
|
||||
}), userOptions);
|
||||
} else {
|
||||
proceed.call(chart, userOptions, callback);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Creates a new SeriesBuilder. A SeriesBuilder consists of a number
|
||||
* of ColumnReaders that reads columns and give them a name.
|
||||
* Ex: A series builder can be constructed to read column 3 as 'x' and
|
||||
* column 7 and 8 as 'y1' and 'y2'.
|
||||
* The output would then be points/rows of the form {x: 11, y1: 22, y2: 33}
|
||||
*
|
||||
* The name of the builder is taken from the second column. In the above
|
||||
* example it would be the column with index 7.
|
||||
* @constructor
|
||||
*/
|
||||
SeriesBuilder = function() {
|
||||
this.readers = [];
|
||||
this.pointIsArray = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Populates readers with column indexes. A reader can be added without
|
||||
* a specific index and for those readers the index is taken sequentially
|
||||
* from the free columns (this is handled by the ColumnCursor instance).
|
||||
* @returns {boolean}
|
||||
*/
|
||||
SeriesBuilder.prototype.populateColumns = function(freeIndexes) {
|
||||
var builder = this,
|
||||
enoughColumns = true;
|
||||
|
||||
// Loop each reader and give it an index if its missing.
|
||||
// The freeIndexes.shift() will return undefined if there
|
||||
// are no more columns.
|
||||
each(builder.readers, function(reader) {
|
||||
if (reader.columnIndex === undefined) {
|
||||
reader.columnIndex = freeIndexes.shift();
|
||||
}
|
||||
});
|
||||
|
||||
// Now, all readers should have columns mapped. If not
|
||||
// then return false to signal that this series should
|
||||
// not be added.
|
||||
each(builder.readers, function(reader) {
|
||||
if (reader.columnIndex === undefined) {
|
||||
enoughColumns = false;
|
||||
}
|
||||
});
|
||||
|
||||
return enoughColumns;
|
||||
};
|
||||
|
||||
/**
|
||||
* Reads a row from the dataset and returns a point or array depending
|
||||
* on the names of the readers.
|
||||
* @param columns
|
||||
* @param rowIndex
|
||||
* @returns {Array | Object}
|
||||
*/
|
||||
SeriesBuilder.prototype.read = function(columns, rowIndex) {
|
||||
var builder = this,
|
||||
pointIsArray = builder.pointIsArray,
|
||||
point = pointIsArray ? [] : {},
|
||||
columnIndexes;
|
||||
|
||||
// Loop each reader and ask it to read its value.
|
||||
// Then, build an array or point based on the readers names.
|
||||
each(builder.readers, function(reader) {
|
||||
var value = columns[reader.columnIndex][rowIndex];
|
||||
if (pointIsArray) {
|
||||
point.push(value);
|
||||
} else {
|
||||
point[reader.configName] = value;
|
||||
}
|
||||
});
|
||||
|
||||
// The name comes from the first column (excluding the x column)
|
||||
if (this.name === undefined && builder.readers.length >= 2) {
|
||||
columnIndexes = builder.getReferencedColumnIndexes();
|
||||
if (columnIndexes.length >= 2) {
|
||||
// remove the first one (x col)
|
||||
columnIndexes.shift();
|
||||
|
||||
// Sort the remaining
|
||||
columnIndexes.sort();
|
||||
|
||||
// Now use the lowest index as name column
|
||||
this.name = columns[columnIndexes.shift()].name;
|
||||
}
|
||||
}
|
||||
|
||||
return point;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates and adds ColumnReader from the given columnIndex and configName.
|
||||
* ColumnIndex can be undefined and in that case the reader will be given
|
||||
* an index when columns are populated.
|
||||
* @param columnIndex {Number | undefined}
|
||||
* @param configName
|
||||
*/
|
||||
SeriesBuilder.prototype.addColumnReader = function(columnIndex, configName) {
|
||||
this.readers.push({
|
||||
columnIndex: columnIndex,
|
||||
configName: configName
|
||||
});
|
||||
|
||||
if (!(configName === 'x' || configName === 'y' || configName === undefined)) {
|
||||
this.pointIsArray = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns an array of column indexes that the builder will use when
|
||||
* reading data.
|
||||
* @returns {Array}
|
||||
*/
|
||||
SeriesBuilder.prototype.getReferencedColumnIndexes = function() {
|
||||
var i,
|
||||
referencedColumnIndexes = [],
|
||||
columnReader;
|
||||
|
||||
for (i = 0; i < this.readers.length; i = i + 1) {
|
||||
columnReader = this.readers[i];
|
||||
if (columnReader.columnIndex !== undefined) {
|
||||
referencedColumnIndexes.push(columnReader.columnIndex);
|
||||
}
|
||||
}
|
||||
|
||||
return referencedColumnIndexes;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if the builder has a reader for the given configName.
|
||||
* @param configName
|
||||
* @returns {boolean}
|
||||
*/
|
||||
SeriesBuilder.prototype.hasReader = function(configName) {
|
||||
var i, columnReader;
|
||||
for (i = 0; i < this.readers.length; i = i + 1) {
|
||||
columnReader = this.readers[i];
|
||||
if (columnReader.configName === configName) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Else return undefined
|
||||
};
|
||||
|
||||
}(Highcharts));
|
||||
}));
|
25
assets/plugin/chart/highcharts/code/js/modules/drilldown.js
Executable file
25
assets/plugin/chart/highcharts/code/js/modules/drilldown.js
Executable file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
Highcharts JS v5.0.2 (2016-10-26)
|
||||
Highcharts Drilldown module
|
||||
|
||||
Author: Torstein Honsi
|
||||
License: www.highcharts.com/license
|
||||
|
||||
*/
|
||||
(function(n){"object"===typeof module&&module.exports?module.exports=n:n(Highcharts)})(function(n){(function(f){function n(a,b,d){var c;b.rgba.length&&a.rgba.length?(a=a.rgba,b=b.rgba,c=1!==b[3]||1!==a[3],a=(c?"rgba(":"rgb(")+Math.round(b[0]+(a[0]-b[0])*(1-d))+","+Math.round(b[1]+(a[1]-b[1])*(1-d))+","+Math.round(b[2]+(a[2]-b[2])*(1-d))+(c?","+(b[3]+(a[3]-b[3])*(1-d)):"")+")"):a=b.input||"none";return a}var C=f.noop,v=f.color,w=f.defaultOptions,l=f.each,p=f.extend,H=f.format,y=f.pick,x=f.wrap,q=f.Chart,
|
||||
t=f.seriesTypes,D=t.pie,r=t.column,E=f.Tick,z=f.fireEvent,F=f.inArray,G=1;l(["fill","stroke"],function(a){f.Fx.prototype[a+"Setter"]=function(){this.elem.attr(a,n(v(this.start),v(this.end),this.pos))}});p(w.lang,{drillUpText:"\u25c1 Back to {series.name}"});w.drilldown={animation:{duration:500},drillUpButton:{position:{align:"right",x:-10,y:10}}};f.SVGRenderer.prototype.Element.prototype.fadeIn=function(a){this.attr({opacity:.1,visibility:"inherit"}).animate({opacity:y(this.newOpacity,1)},a||{duration:250})};
|
||||
q.prototype.addSeriesAsDrilldown=function(a,b){this.addSingleSeriesAsDrilldown(a,b);this.applyDrilldown()};q.prototype.addSingleSeriesAsDrilldown=function(a,b){var d=a.series,c=d.xAxis,e=d.yAxis,h,g=[],k=[],u,m,A;A={colorIndex:y(a.colorIndex,d.colorIndex)};this.drilldownLevels||(this.drilldownLevels=[]);u=d.options._levelNumber||0;(m=this.drilldownLevels[this.drilldownLevels.length-1])&&m.levelNumber!==u&&(m=void 0);b=p(p({_ddSeriesId:G++},A),b);h=F(a,d.points);l(d.chart.series,function(a){a.xAxis!==
|
||||
c||a.isDrilling||(a.options._ddSeriesId=a.options._ddSeriesId||G++,a.options._colorIndex=a.userOptions._colorIndex,a.options._levelNumber=a.options._levelNumber||u,m?(g=m.levelSeries,k=m.levelSeriesOptions):(g.push(a),k.push(a.options)))});a=p({levelNumber:u,seriesOptions:d.options,levelSeriesOptions:k,levelSeries:g,shapeArgs:a.shapeArgs,bBox:a.graphic?a.graphic.getBBox():{},color:a.isNull?(new f.Color(v)).setOpacity(0).get():v,lowerSeriesOptions:b,pointOptions:d.options.data[h],pointIndex:h,oldExtremes:{xMin:c&&
|
||||
c.userMin,xMax:c&&c.userMax,yMin:e&&e.userMin,yMax:e&&e.userMax}},A);this.drilldownLevels.push(a);b=a.lowerSeries=this.addSeries(b,!1);b.options._levelNumber=u+1;c&&(c.oldPos=c.pos,c.userMin=c.userMax=null,e.userMin=e.userMax=null);d.type===b.type&&(b.animate=b.animateDrilldown||C,b.options.animation=!0)};q.prototype.applyDrilldown=function(){var a=this.drilldownLevels,b;a&&0<a.length&&(b=a[a.length-1].levelNumber,l(this.drilldownLevels,function(a){a.levelNumber===b&&l(a.levelSeries,function(a){a.options&&
|
||||
a.options._levelNumber===b&&a.remove(!1)})}));this.redraw();this.showDrillUpButton()};q.prototype.getDrilldownBackText=function(){var a=this.drilldownLevels;if(a&&0<a.length)return a=a[a.length-1],a.series=a.seriesOptions,H(this.options.lang.drillUpText,a)};q.prototype.showDrillUpButton=function(){var a=this,b=this.getDrilldownBackText(),d=a.options.drilldown.drillUpButton,c,e;this.drillUpButton?this.drillUpButton.attr({text:b}).align():(e=(c=d.theme)&&c.states,this.drillUpButton=this.renderer.button(b,
|
||||
null,null,function(){a.drillUp()},c,e&&e.hover,e&&e.select).addClass("highcharts-drillup-button").attr({align:d.position.align,zIndex:7}).add().align(d.position,!1,d.relativeTo||"plotBox"))};q.prototype.drillUp=function(){for(var a=this,b=a.drilldownLevels,d=b[b.length-1].levelNumber,c=b.length,e=a.series,h,g,k,f,m=function(c){var b;l(e,function(a){a.options._ddSeriesId===c._ddSeriesId&&(b=a)});b=b||a.addSeries(c,!1);b.type===k.type&&b.animateDrillupTo&&(b.animate=b.animateDrillupTo);c===g.seriesOptions&&
|
||||
(f=b)};c--;)if(g=b[c],g.levelNumber===d){b.pop();k=g.lowerSeries;if(!k.chart)for(h=e.length;h--;)if(e[h].options.id===g.lowerSeriesOptions.id&&e[h].options._levelNumber===d+1){k=e[h];break}k.xData=[];l(g.levelSeriesOptions,m);z(a,"drillup",{seriesOptions:g.seriesOptions});f.type===k.type&&(f.drilldownLevel=g,f.options.animation=a.options.drilldown.animation,k.animateDrillupFrom&&k.chart&&k.animateDrillupFrom(g));f.options._levelNumber=d;k.remove(!1);f.xAxis&&(h=g.oldExtremes,f.xAxis.setExtremes(h.xMin,
|
||||
h.xMax,!1),f.yAxis.setExtremes(h.yMin,h.yMax,!1))}z(a,"drillupall");this.redraw();0===this.drilldownLevels.length?this.drillUpButton=this.drillUpButton.destroy():this.drillUpButton.attr({text:this.getDrilldownBackText()}).align();this.ddDupes.length=[]};r.prototype.supportsDrilldown=!0;r.prototype.animateDrillupTo=function(a){if(!a){var b=this,d=b.drilldownLevel;l(this.points,function(a){a.graphic&&a.graphic.hide();a.dataLabel&&a.dataLabel.hide();a.connector&&a.connector.hide()});setTimeout(function(){b.points&&
|
||||
l(b.points,function(a,b){b=b===(d&&d.pointIndex)?"show":"fadeIn";var c="show"===b?!0:void 0;if(a.graphic)a.graphic[b](c);if(a.dataLabel)a.dataLabel[b](c);if(a.connector)a.connector[b](c)})},Math.max(this.chart.options.drilldown.animation.duration-50,0));this.animate=C}};r.prototype.animateDrilldown=function(a){var b=this,d=this.chart.drilldownLevels,c,e=this.chart.options.drilldown.animation,h=this.xAxis;a||(l(d,function(a){b.options._ddSeriesId===a.lowerSeriesOptions._ddSeriesId&&(c=a.shapeArgs)}),
|
||||
c.x+=y(h.oldPos,h.pos)-h.pos,l(this.points,function(a){a.graphic&&a.graphic.attr(c).animate(p(a.shapeArgs,{fill:a.color||b.color}),e);a.dataLabel&&a.dataLabel.fadeIn(e)}),this.animate=null)};r.prototype.animateDrillupFrom=function(a){var b=this.chart.options.drilldown.animation,d=this.group,c=this;l(c.trackerGroups,function(a){if(c[a])c[a].on("mouseover")});delete this.group;l(this.points,function(c){var e=c.graphic,g=a.shapeArgs,k=function(){e.destroy();d&&(d=d.destroy())};e&&(delete c.graphic,b?
|
||||
e.animate(g,f.merge(b,{complete:k})):(e.attr(g),k()))})};D&&p(D.prototype,{supportsDrilldown:!0,animateDrillupTo:r.prototype.animateDrillupTo,animateDrillupFrom:r.prototype.animateDrillupFrom,animateDrilldown:function(a){var b=this.chart.options.drilldown.animation,d=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1].shapeArgs,c=d.start,e=(d.end-c)/this.points.length;a||(l(this.points,function(a,g){var h=a.shapeArgs;if(a.graphic)a.graphic.attr(f.merge(d,{start:c+g*e,end:c+(g+1)*e}))[b?
|
||||
"animate":"attr"](h,b)}),this.animate=null)}});f.Point.prototype.doDrilldown=function(a,b,d){var c=this.series.chart,e=c.options.drilldown,f=(e.series||[]).length,g;c.ddDupes||(c.ddDupes=[]);for(;f--&&!g;)e.series[f].id===this.drilldown&&-1===F(this.drilldown,c.ddDupes)&&(g=e.series[f],c.ddDupes.push(this.drilldown));z(c,"drilldown",{point:this,seriesOptions:g,category:b,originalEvent:d,points:void 0!==b&&this.series.xAxis.getDDPoints(b).slice(0)},function(b){var c=b.point.series&&b.point.series.chart,
|
||||
d=b.seriesOptions;c&&d&&(a?c.addSingleSeriesAsDrilldown(b.point,d):c.addSeriesAsDrilldown(b.point,d))})};f.Axis.prototype.drilldownCategory=function(a,b){var d,c,e=this.getDDPoints(a);for(d in e)(c=e[d])&&c.series&&c.series.visible&&c.doDrilldown&&c.doDrilldown(!0,a,b);this.chart.applyDrilldown()};f.Axis.prototype.getDDPoints=function(a){var b=[];l(this.series,function(d){var c,e=d.xData,f=d.points;for(c=0;c<e.length;c++)if(e[c]===a&&d.options.data[c]&&d.options.data[c].drilldown){b.push(f?f[c]:!0);
|
||||
break}});return b};E.prototype.drillable=function(){var a=this.pos,b=this.label,d=this.axis,c="xAxis"===d.coll&&d.getDDPoints,e=c&&d.getDDPoints(a);c&&(b&&e.length?(b.drillable=!0,b.addClass("highcharts-drilldown-axis-label").on("click",function(b){d.drilldownCategory(a,b)})):b&&b.drillable&&(b.on("click",null),b.removeClass("highcharts-drilldown-axis-label")))};x(E.prototype,"addLabel",function(a){a.call(this);this.drillable()});x(f.Point.prototype,"init",function(a,b,d,c){var e=a.call(this,b,d,
|
||||
c);c=(a=b.xAxis)&&a.ticks[c];e.drilldown&&f.addEvent(e,"click",function(a){b.xAxis&&!1===b.chart.options.drilldown.allowPointDrilldown?b.xAxis.drilldownCategory(e.x,a):e.doDrilldown(void 0,void 0,a)});c&&c.drillable();return e});x(f.Series.prototype,"drawDataLabels",function(a){var b=this.chart.options.drilldown.activeDataLabelStyle,d=this.chart.renderer;a.call(this);l(this.points,function(a){a.drilldown&&a.dataLabel&&("contrast"===b.color&&d.getContrast(a.color||this.color),a.dataLabel.addClass("highcharts-drilldown-data-label"))},
|
||||
this)});var B,w=function(a){a.call(this);l(this.points,function(a){a.drilldown&&a.graphic&&a.graphic.addClass("highcharts-drilldown-point")})};for(B in t)t[B].prototype.supportsDrilldown&&x(t[B].prototype,"drawTracker",w)})(n)});
|
751
assets/plugin/chart/highcharts/code/js/modules/drilldown.src.js
Executable file
751
assets/plugin/chart/highcharts/code/js/modules/drilldown.src.js
Executable file
@ -0,0 +1,751 @@
|
||||
/**
|
||||
* @license Highcharts JS v5.0.2 (2016-10-26)
|
||||
* Highcharts Drilldown module
|
||||
*
|
||||
* Author: Torstein Honsi
|
||||
* License: www.highcharts.com/license
|
||||
*
|
||||
*/
|
||||
(function(factory) {
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
module.exports = factory;
|
||||
} else {
|
||||
factory(Highcharts);
|
||||
}
|
||||
}(function(Highcharts) {
|
||||
(function(H) {
|
||||
/**
|
||||
* Highcharts Drilldown module
|
||||
*
|
||||
* Author: Torstein Honsi
|
||||
* License: www.highcharts.com/license
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var noop = H.noop,
|
||||
color = H.color,
|
||||
defaultOptions = H.defaultOptions,
|
||||
each = H.each,
|
||||
extend = H.extend,
|
||||
format = H.format,
|
||||
pick = H.pick,
|
||||
wrap = H.wrap,
|
||||
Chart = H.Chart,
|
||||
seriesTypes = H.seriesTypes,
|
||||
PieSeries = seriesTypes.pie,
|
||||
ColumnSeries = seriesTypes.column,
|
||||
Tick = H.Tick,
|
||||
fireEvent = H.fireEvent,
|
||||
inArray = H.inArray,
|
||||
ddSeriesId = 1;
|
||||
|
||||
// Utilities
|
||||
/*
|
||||
* Return an intermediate color between two colors, according to pos where 0
|
||||
* is the from color and 1 is the to color. This method is copied from ColorAxis.js
|
||||
* and should always be kept updated, until we get AMD support.
|
||||
*/
|
||||
function tweenColors(from, to, pos) {
|
||||
// Check for has alpha, because rgba colors perform worse due to lack of
|
||||
// support in WebKit.
|
||||
var hasAlpha,
|
||||
ret;
|
||||
|
||||
// Unsupported color, return to-color (#3920)
|
||||
if (!to.rgba.length || !from.rgba.length) {
|
||||
ret = to.input || 'none';
|
||||
|
||||
// Interpolate
|
||||
} else {
|
||||
from = from.rgba;
|
||||
to = to.rgba;
|
||||
hasAlpha = (to[3] !== 1 || from[3] !== 1);
|
||||
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
|
||||
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
|
||||
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
|
||||
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
|
||||
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* Handle animation of the color attributes directly
|
||||
*/
|
||||
each(['fill', 'stroke'], function(prop) {
|
||||
H.Fx.prototype[prop + 'Setter'] = function() {
|
||||
this.elem.attr(prop, tweenColors(color(this.start), color(this.end), this.pos));
|
||||
};
|
||||
});
|
||||
|
||||
// Add language
|
||||
extend(defaultOptions.lang, {
|
||||
drillUpText: '◁ Back to {series.name}'
|
||||
});
|
||||
defaultOptions.drilldown = {
|
||||
|
||||
animation: {
|
||||
duration: 500
|
||||
},
|
||||
drillUpButton: {
|
||||
position: {
|
||||
align: 'right',
|
||||
x: -10,
|
||||
y: 10
|
||||
}
|
||||
// relativeTo: 'plotBox'
|
||||
// theme
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A general fadeIn method
|
||||
*/
|
||||
H.SVGRenderer.prototype.Element.prototype.fadeIn = function(animation) {
|
||||
this
|
||||
.attr({
|
||||
opacity: 0.1,
|
||||
visibility: 'inherit'
|
||||
})
|
||||
.animate({
|
||||
opacity: pick(this.newOpacity, 1) // newOpacity used in maps
|
||||
}, animation || {
|
||||
duration: 250
|
||||
});
|
||||
};
|
||||
|
||||
Chart.prototype.addSeriesAsDrilldown = function(point, ddOptions) {
|
||||
this.addSingleSeriesAsDrilldown(point, ddOptions);
|
||||
this.applyDrilldown();
|
||||
};
|
||||
Chart.prototype.addSingleSeriesAsDrilldown = function(point, ddOptions) {
|
||||
var oldSeries = point.series,
|
||||
xAxis = oldSeries.xAxis,
|
||||
yAxis = oldSeries.yAxis,
|
||||
newSeries,
|
||||
pointIndex,
|
||||
levelSeries = [],
|
||||
levelSeriesOptions = [],
|
||||
level,
|
||||
levelNumber,
|
||||
last,
|
||||
colorProp;
|
||||
|
||||
|
||||
|
||||
colorProp = {
|
||||
colorIndex: pick(point.colorIndex, oldSeries.colorIndex)
|
||||
};
|
||||
|
||||
|
||||
if (!this.drilldownLevels) {
|
||||
this.drilldownLevels = [];
|
||||
}
|
||||
|
||||
levelNumber = oldSeries.options._levelNumber || 0;
|
||||
|
||||
// See if we can reuse the registered series from last run
|
||||
last = this.drilldownLevels[this.drilldownLevels.length - 1];
|
||||
if (last && last.levelNumber !== levelNumber) {
|
||||
last = undefined;
|
||||
}
|
||||
|
||||
ddOptions = extend(extend({
|
||||
_ddSeriesId: ddSeriesId++
|
||||
}, colorProp), ddOptions);
|
||||
pointIndex = inArray(point, oldSeries.points);
|
||||
|
||||
// Record options for all current series
|
||||
each(oldSeries.chart.series, function(series) {
|
||||
if (series.xAxis === xAxis && !series.isDrilling) {
|
||||
series.options._ddSeriesId = series.options._ddSeriesId || ddSeriesId++;
|
||||
series.options._colorIndex = series.userOptions._colorIndex;
|
||||
series.options._levelNumber = series.options._levelNumber || levelNumber; // #3182
|
||||
|
||||
if (last) {
|
||||
levelSeries = last.levelSeries;
|
||||
levelSeriesOptions = last.levelSeriesOptions;
|
||||
} else {
|
||||
levelSeries.push(series);
|
||||
levelSeriesOptions.push(series.options);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Add a record of properties for each drilldown level
|
||||
level = extend({
|
||||
levelNumber: levelNumber,
|
||||
seriesOptions: oldSeries.options,
|
||||
levelSeriesOptions: levelSeriesOptions,
|
||||
levelSeries: levelSeries,
|
||||
shapeArgs: point.shapeArgs,
|
||||
bBox: point.graphic ? point.graphic.getBBox() : {}, // no graphic in line series with markers disabled
|
||||
color: point.isNull ? new H.Color(color).setOpacity(0).get() : color,
|
||||
lowerSeriesOptions: ddOptions,
|
||||
pointOptions: oldSeries.options.data[pointIndex],
|
||||
pointIndex: pointIndex,
|
||||
oldExtremes: {
|
||||
xMin: xAxis && xAxis.userMin,
|
||||
xMax: xAxis && xAxis.userMax,
|
||||
yMin: yAxis && yAxis.userMin,
|
||||
yMax: yAxis && yAxis.userMax
|
||||
}
|
||||
}, colorProp);
|
||||
|
||||
// Push it to the lookup array
|
||||
this.drilldownLevels.push(level);
|
||||
|
||||
newSeries = level.lowerSeries = this.addSeries(ddOptions, false);
|
||||
newSeries.options._levelNumber = levelNumber + 1;
|
||||
if (xAxis) {
|
||||
xAxis.oldPos = xAxis.pos;
|
||||
xAxis.userMin = xAxis.userMax = null;
|
||||
yAxis.userMin = yAxis.userMax = null;
|
||||
}
|
||||
|
||||
// Run fancy cross-animation on supported and equal types
|
||||
if (oldSeries.type === newSeries.type) {
|
||||
newSeries.animate = newSeries.animateDrilldown || noop;
|
||||
newSeries.options.animation = true;
|
||||
}
|
||||
};
|
||||
|
||||
Chart.prototype.applyDrilldown = function() {
|
||||
var drilldownLevels = this.drilldownLevels,
|
||||
levelToRemove;
|
||||
|
||||
if (drilldownLevels && drilldownLevels.length > 0) { // #3352, async loading
|
||||
levelToRemove = drilldownLevels[drilldownLevels.length - 1].levelNumber;
|
||||
each(this.drilldownLevels, function(level) {
|
||||
if (level.levelNumber === levelToRemove) {
|
||||
each(level.levelSeries, function(series) {
|
||||
if (series.options && series.options._levelNumber === levelToRemove) { // Not removed, not added as part of a multi-series drilldown
|
||||
series.remove(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.redraw();
|
||||
this.showDrillUpButton();
|
||||
};
|
||||
|
||||
Chart.prototype.getDrilldownBackText = function() {
|
||||
var drilldownLevels = this.drilldownLevels,
|
||||
lastLevel;
|
||||
if (drilldownLevels && drilldownLevels.length > 0) { // #3352, async loading
|
||||
lastLevel = drilldownLevels[drilldownLevels.length - 1];
|
||||
lastLevel.series = lastLevel.seriesOptions;
|
||||
return format(this.options.lang.drillUpText, lastLevel);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Chart.prototype.showDrillUpButton = function() {
|
||||
var chart = this,
|
||||
backText = this.getDrilldownBackText(),
|
||||
buttonOptions = chart.options.drilldown.drillUpButton,
|
||||
attr,
|
||||
states;
|
||||
|
||||
|
||||
if (!this.drillUpButton) {
|
||||
attr = buttonOptions.theme;
|
||||
states = attr && attr.states;
|
||||
|
||||
this.drillUpButton = this.renderer.button(
|
||||
backText,
|
||||
null,
|
||||
null,
|
||||
function() {
|
||||
chart.drillUp();
|
||||
},
|
||||
attr,
|
||||
states && states.hover,
|
||||
states && states.select
|
||||
)
|
||||
.addClass('highcharts-drillup-button')
|
||||
.attr({
|
||||
align: buttonOptions.position.align,
|
||||
zIndex: 7
|
||||
})
|
||||
.add()
|
||||
.align(buttonOptions.position, false, buttonOptions.relativeTo || 'plotBox');
|
||||
} else {
|
||||
this.drillUpButton.attr({
|
||||
text: backText
|
||||
})
|
||||
.align();
|
||||
}
|
||||
};
|
||||
|
||||
Chart.prototype.drillUp = function() {
|
||||
var chart = this,
|
||||
drilldownLevels = chart.drilldownLevels,
|
||||
levelNumber = drilldownLevels[drilldownLevels.length - 1].levelNumber,
|
||||
i = drilldownLevels.length,
|
||||
chartSeries = chart.series,
|
||||
seriesI,
|
||||
level,
|
||||
oldSeries,
|
||||
newSeries,
|
||||
oldExtremes,
|
||||
addSeries = function(seriesOptions) {
|
||||
var addedSeries;
|
||||
each(chartSeries, function(series) {
|
||||
if (series.options._ddSeriesId === seriesOptions._ddSeriesId) {
|
||||
addedSeries = series;
|
||||
}
|
||||
});
|
||||
|
||||
addedSeries = addedSeries || chart.addSeries(seriesOptions, false);
|
||||
if (addedSeries.type === oldSeries.type && addedSeries.animateDrillupTo) {
|
||||
addedSeries.animate = addedSeries.animateDrillupTo;
|
||||
}
|
||||
if (seriesOptions === level.seriesOptions) {
|
||||
newSeries = addedSeries;
|
||||
}
|
||||
};
|
||||
|
||||
while (i--) {
|
||||
|
||||
level = drilldownLevels[i];
|
||||
if (level.levelNumber === levelNumber) {
|
||||
drilldownLevels.pop();
|
||||
|
||||
// Get the lower series by reference or id
|
||||
oldSeries = level.lowerSeries;
|
||||
if (!oldSeries.chart) { // #2786
|
||||
seriesI = chartSeries.length; // #2919
|
||||
while (seriesI--) {
|
||||
if (chartSeries[seriesI].options.id === level.lowerSeriesOptions.id &&
|
||||
chartSeries[seriesI].options._levelNumber === levelNumber + 1) { // #3867
|
||||
oldSeries = chartSeries[seriesI];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
oldSeries.xData = []; // Overcome problems with minRange (#2898)
|
||||
|
||||
each(level.levelSeriesOptions, addSeries);
|
||||
|
||||
fireEvent(chart, 'drillup', {
|
||||
seriesOptions: level.seriesOptions
|
||||
});
|
||||
|
||||
if (newSeries.type === oldSeries.type) {
|
||||
newSeries.drilldownLevel = level;
|
||||
newSeries.options.animation = chart.options.drilldown.animation;
|
||||
|
||||
if (oldSeries.animateDrillupFrom && oldSeries.chart) { // #2919
|
||||
oldSeries.animateDrillupFrom(level);
|
||||
}
|
||||
}
|
||||
newSeries.options._levelNumber = levelNumber;
|
||||
|
||||
oldSeries.remove(false);
|
||||
|
||||
// Reset the zoom level of the upper series
|
||||
if (newSeries.xAxis) {
|
||||
oldExtremes = level.oldExtremes;
|
||||
newSeries.xAxis.setExtremes(oldExtremes.xMin, oldExtremes.xMax, false);
|
||||
newSeries.yAxis.setExtremes(oldExtremes.yMin, oldExtremes.yMax, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fire a once-off event after all series have been drilled up (#5158)
|
||||
fireEvent(chart, 'drillupall');
|
||||
|
||||
this.redraw();
|
||||
|
||||
if (this.drilldownLevels.length === 0) {
|
||||
this.drillUpButton = this.drillUpButton.destroy();
|
||||
} else {
|
||||
this.drillUpButton.attr({
|
||||
text: this.getDrilldownBackText()
|
||||
})
|
||||
.align();
|
||||
}
|
||||
|
||||
this.ddDupes.length = []; // #3315
|
||||
};
|
||||
|
||||
|
||||
ColumnSeries.prototype.supportsDrilldown = true;
|
||||
|
||||
/**
|
||||
* When drilling up, keep the upper series invisible until the lower series has
|
||||
* moved into place
|
||||
*/
|
||||
ColumnSeries.prototype.animateDrillupTo = function(init) {
|
||||
if (!init) {
|
||||
var newSeries = this,
|
||||
level = newSeries.drilldownLevel;
|
||||
|
||||
each(this.points, function(point) {
|
||||
if (point.graphic) { // #3407
|
||||
point.graphic.hide();
|
||||
}
|
||||
if (point.dataLabel) {
|
||||
point.dataLabel.hide();
|
||||
}
|
||||
if (point.connector) {
|
||||
point.connector.hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Do dummy animation on first point to get to complete
|
||||
setTimeout(function() {
|
||||
if (newSeries.points) { // May be destroyed in the meantime, #3389
|
||||
each(newSeries.points, function(point, i) {
|
||||
// Fade in other points
|
||||
var verb = i === (level && level.pointIndex) ? 'show' : 'fadeIn',
|
||||
inherit = verb === 'show' ? true : undefined;
|
||||
if (point.graphic) { // #3407
|
||||
point.graphic[verb](inherit);
|
||||
}
|
||||
if (point.dataLabel) {
|
||||
point.dataLabel[verb](inherit);
|
||||
}
|
||||
if (point.connector) {
|
||||
point.connector[verb](inherit);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, Math.max(this.chart.options.drilldown.animation.duration - 50, 0));
|
||||
|
||||
// Reset
|
||||
this.animate = noop;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
ColumnSeries.prototype.animateDrilldown = function(init) {
|
||||
var series = this,
|
||||
drilldownLevels = this.chart.drilldownLevels,
|
||||
animateFrom,
|
||||
animationOptions = this.chart.options.drilldown.animation,
|
||||
xAxis = this.xAxis;
|
||||
|
||||
if (!init) {
|
||||
each(drilldownLevels, function(level) {
|
||||
if (series.options._ddSeriesId === level.lowerSeriesOptions._ddSeriesId) {
|
||||
animateFrom = level.shapeArgs;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
animateFrom.x += (pick(xAxis.oldPos, xAxis.pos) - xAxis.pos);
|
||||
|
||||
each(this.points, function(point) {
|
||||
var animateTo = point.shapeArgs;
|
||||
|
||||
|
||||
|
||||
if (point.graphic) {
|
||||
point.graphic
|
||||
.attr(animateFrom)
|
||||
.animate(
|
||||
extend(point.shapeArgs, {
|
||||
fill: point.color || series.color
|
||||
}),
|
||||
animationOptions
|
||||
);
|
||||
}
|
||||
if (point.dataLabel) {
|
||||
point.dataLabel.fadeIn(animationOptions);
|
||||
}
|
||||
});
|
||||
this.animate = null;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* When drilling up, pull out the individual point graphics from the lower series
|
||||
* and animate them into the origin point in the upper series.
|
||||
*/
|
||||
ColumnSeries.prototype.animateDrillupFrom = function(level) {
|
||||
var animationOptions = this.chart.options.drilldown.animation,
|
||||
group = this.group,
|
||||
series = this;
|
||||
|
||||
// Cancel mouse events on the series group (#2787)
|
||||
each(series.trackerGroups, function(key) {
|
||||
if (series[key]) { // we don't always have dataLabelsGroup
|
||||
series[key].on('mouseover');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
delete this.group;
|
||||
each(this.points, function(point) {
|
||||
var graphic = point.graphic,
|
||||
animateTo = level.shapeArgs,
|
||||
complete = function() {
|
||||
graphic.destroy();
|
||||
if (group) {
|
||||
group = group.destroy();
|
||||
}
|
||||
};
|
||||
|
||||
if (graphic) {
|
||||
|
||||
delete point.graphic;
|
||||
|
||||
|
||||
|
||||
if (animationOptions) {
|
||||
graphic.animate(
|
||||
animateTo,
|
||||
H.merge(animationOptions, {
|
||||
complete: complete
|
||||
})
|
||||
);
|
||||
} else {
|
||||
graphic.attr(animateTo);
|
||||
complete();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (PieSeries) {
|
||||
extend(PieSeries.prototype, {
|
||||
supportsDrilldown: true,
|
||||
animateDrillupTo: ColumnSeries.prototype.animateDrillupTo,
|
||||
animateDrillupFrom: ColumnSeries.prototype.animateDrillupFrom,
|
||||
|
||||
animateDrilldown: function(init) {
|
||||
var level = this.chart.drilldownLevels[this.chart.drilldownLevels.length - 1],
|
||||
animationOptions = this.chart.options.drilldown.animation,
|
||||
animateFrom = level.shapeArgs,
|
||||
start = animateFrom.start,
|
||||
angle = animateFrom.end - start,
|
||||
startAngle = angle / this.points.length;
|
||||
|
||||
if (!init) {
|
||||
each(this.points, function(point, i) {
|
||||
var animateTo = point.shapeArgs;
|
||||
|
||||
|
||||
|
||||
if (point.graphic) {
|
||||
point.graphic
|
||||
.attr(H.merge(animateFrom, {
|
||||
start: start + i * startAngle,
|
||||
end: start + (i + 1) * startAngle
|
||||
}))[animationOptions ? 'animate' : 'attr'](
|
||||
animateTo,
|
||||
animationOptions
|
||||
);
|
||||
}
|
||||
});
|
||||
this.animate = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
H.Point.prototype.doDrilldown = function(_holdRedraw, category, originalEvent) {
|
||||
var series = this.series,
|
||||
chart = series.chart,
|
||||
drilldown = chart.options.drilldown,
|
||||
i = (drilldown.series || []).length,
|
||||
seriesOptions;
|
||||
|
||||
if (!chart.ddDupes) {
|
||||
chart.ddDupes = [];
|
||||
}
|
||||
|
||||
while (i-- && !seriesOptions) {
|
||||
if (drilldown.series[i].id === this.drilldown && inArray(this.drilldown, chart.ddDupes) === -1) {
|
||||
seriesOptions = drilldown.series[i];
|
||||
chart.ddDupes.push(this.drilldown);
|
||||
}
|
||||
}
|
||||
|
||||
// Fire the event. If seriesOptions is undefined, the implementer can check for
|
||||
// seriesOptions, and call addSeriesAsDrilldown async if necessary.
|
||||
fireEvent(chart, 'drilldown', {
|
||||
point: this,
|
||||
seriesOptions: seriesOptions,
|
||||
category: category,
|
||||
originalEvent: originalEvent,
|
||||
points: category !== undefined && this.series.xAxis.getDDPoints(category).slice(0)
|
||||
}, function(e) {
|
||||
var chart = e.point.series && e.point.series.chart,
|
||||
seriesOptions = e.seriesOptions;
|
||||
if (chart && seriesOptions) {
|
||||
if (_holdRedraw) {
|
||||
chart.addSingleSeriesAsDrilldown(e.point, seriesOptions);
|
||||
} else {
|
||||
chart.addSeriesAsDrilldown(e.point, seriesOptions);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Drill down to a given category. This is the same as clicking on an axis label.
|
||||
*/
|
||||
H.Axis.prototype.drilldownCategory = function(x, e) {
|
||||
var key,
|
||||
point,
|
||||
ddPointsX = this.getDDPoints(x);
|
||||
for (key in ddPointsX) {
|
||||
point = ddPointsX[key];
|
||||
if (point && point.series && point.series.visible && point.doDrilldown) { // #3197
|
||||
point.doDrilldown(true, x, e);
|
||||
}
|
||||
}
|
||||
this.chart.applyDrilldown();
|
||||
};
|
||||
|
||||
/**
|
||||
* Return drillable points for this specific X value
|
||||
*/
|
||||
H.Axis.prototype.getDDPoints = function(x) {
|
||||
var ret = [];
|
||||
each(this.series, function(series) {
|
||||
var i,
|
||||
xData = series.xData,
|
||||
points = series.points;
|
||||
|
||||
for (i = 0; i < xData.length; i++) {
|
||||
if (xData[i] === x && series.options.data[i] && series.options.data[i].drilldown) {
|
||||
ret.push(points ? points[i] : true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Make a tick label drillable, or remove drilling on update
|
||||
*/
|
||||
Tick.prototype.drillable = function() {
|
||||
var pos = this.pos,
|
||||
label = this.label,
|
||||
axis = this.axis,
|
||||
isDrillable = axis.coll === 'xAxis' && axis.getDDPoints,
|
||||
ddPointsX = isDrillable && axis.getDDPoints(pos);
|
||||
|
||||
if (isDrillable) {
|
||||
if (label && ddPointsX.length) {
|
||||
label.drillable = true;
|
||||
|
||||
|
||||
|
||||
label
|
||||
.addClass('highcharts-drilldown-axis-label')
|
||||
|
||||
.on('click', function(e) {
|
||||
axis.drilldownCategory(pos, e);
|
||||
});
|
||||
|
||||
} else if (label && label.drillable) {
|
||||
|
||||
|
||||
|
||||
label.on('click', null); // #3806
|
||||
label.removeClass('highcharts-drilldown-axis-label');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Always keep the drillability updated (#3951)
|
||||
*/
|
||||
wrap(Tick.prototype, 'addLabel', function(proceed) {
|
||||
proceed.call(this);
|
||||
this.drillable();
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* On initialization of each point, identify its label and make it clickable. Also, provide a
|
||||
* list of points associated to that label.
|
||||
*/
|
||||
wrap(H.Point.prototype, 'init', function(proceed, series, options, x) {
|
||||
var point = proceed.call(this, series, options, x),
|
||||
xAxis = series.xAxis,
|
||||
tick = xAxis && xAxis.ticks[x];
|
||||
|
||||
if (point.drilldown) {
|
||||
|
||||
// Add the click event to the point
|
||||
H.addEvent(point, 'click', function(e) {
|
||||
if (series.xAxis && series.chart.options.drilldown.allowPointDrilldown === false) {
|
||||
series.xAxis.drilldownCategory(point.x, e); // #5822, x changed
|
||||
} else {
|
||||
point.doDrilldown(undefined, undefined, e);
|
||||
}
|
||||
});
|
||||
/*wrap(point, 'importEvents', function (proceed) { // wrapping importEvents makes point.click event work
|
||||
if (!this.hasImportedEvents) {
|
||||
proceed.call(this);
|
||||
H.addEvent(this, 'click', function () {
|
||||
this.doDrilldown();
|
||||
});
|
||||
}
|
||||
});*/
|
||||
|
||||
}
|
||||
|
||||
// Add or remove click handler and style on the tick label
|
||||
if (tick) {
|
||||
tick.drillable();
|
||||
}
|
||||
|
||||
return point;
|
||||
});
|
||||
|
||||
wrap(H.Series.prototype, 'drawDataLabels', function(proceed) {
|
||||
var css = this.chart.options.drilldown.activeDataLabelStyle,
|
||||
renderer = this.chart.renderer;
|
||||
|
||||
proceed.call(this);
|
||||
|
||||
each(this.points, function(point) {
|
||||
var pointCSS = {};
|
||||
if (point.drilldown && point.dataLabel) {
|
||||
if (css.color === 'contrast') {
|
||||
pointCSS.color = renderer.getContrast(point.color || this.color);
|
||||
}
|
||||
point.dataLabel
|
||||
.addClass('highcharts-drilldown-data-label');
|
||||
|
||||
|
||||
}
|
||||
}, this);
|
||||
});
|
||||
|
||||
// Mark the trackers with a pointer
|
||||
var type,
|
||||
drawTrackerWrapper = function(proceed) {
|
||||
proceed.call(this);
|
||||
each(this.points, function(point) {
|
||||
if (point.drilldown && point.graphic) {
|
||||
point.graphic.addClass('highcharts-drilldown-point');
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
for (type in seriesTypes) {
|
||||
if (seriesTypes[type].prototype.supportsDrilldown) {
|
||||
wrap(seriesTypes[type].prototype, 'drawTracker', drawTrackerWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
}(Highcharts));
|
||||
}));
|
26
assets/plugin/chart/highcharts/code/js/modules/exporting.js
Executable file
26
assets/plugin/chart/highcharts/code/js/modules/exporting.js
Executable file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
Highcharts JS v5.0.2 (2016-10-26)
|
||||
Exporting module
|
||||
|
||||
(c) 2010-2016 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(q){"object"===typeof module&&module.exports?module.exports=q:q(Highcharts)})(function(q){(function(f){var q=f.defaultOptions,v=f.doc,A=f.Chart,x=f.addEvent,F=f.removeEvent,G=f.fireEvent,w=f.createElement,B=f.discardElement,H=f.css,p=f.merge,C=f.pick,u=f.each,y=f.extend,I=f.splat,z=f.win,D=f.SVGRenderer,J=f.Renderer.prototype.symbols;y(q.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",
|
||||
contextButtonTitle:"Chart context menu"});q.navigation={buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}};q.exporting={type:"image/png",url:"https://export.highcharts.com/",printMaxWidth:780,scale:2,buttons:{contextButton:{className:"highcharts-contextbutton",menuClassName:"highcharts-contextmenu",symbol:"menu",_titleKey:"contextButtonTitle",menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},
|
||||
{textKey:"downloadPNG",onclick:function(){this.exportChart()}},{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}]}}};f.post=function(a,b,d){var e;a=w("form",p({method:"post",action:a,enctype:"multipart/form-data"},d),{display:"none"},v.body);for(e in b)w("input",{type:"hidden",name:e,value:b[e]},
|
||||
null,a);a.submit();B(a)};y(A.prototype,{sanitizeSVG:function(a){return a=a.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|")(\S+)("|")\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'\x3csvg xmlns:xlink\x3d"http://www.w3.org/1999/xlink" ').replace(/ (NS[0-9]+\:)?href=/g," xlink:href\x3d").replace(/\n/," ").replace(/<\/svg>.*?$/,"\x3c/svg\x3e").replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g,
|
||||
'$1\x3d"rgb($2)" $1-opacity\x3d"$3"').replace(/ /g,"\u00a0").replace(/­/g,"\u00ad")},getChartHTML:function(){this.inlineStyles();return this.container.innerHTML},getSVG:function(a){var b=this,d,e,g,E,k,c=p(b.options,a),n=c.exporting.allowHTML;v.createElementNS||(v.createElementNS=function(a,b){return v.createElement(b)});e=w("div",null,{position:"absolute",top:"-9999em",width:b.chartWidth+"px",height:b.chartHeight+"px"},v.body);g=b.renderTo.style.width;k=b.renderTo.style.height;g=c.exporting.sourceWidth||
|
||||
c.chart.width||/px$/.test(g)&&parseInt(g,10)||600;k=c.exporting.sourceHeight||c.chart.height||/px$/.test(k)&&parseInt(k,10)||400;y(c.chart,{animation:!1,renderTo:e,forExport:!0,renderer:"SVGRenderer",width:g,height:k});c.exporting.enabled=!1;delete c.data;c.series=[];u(b.series,function(a){E=p(a.userOptions,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});E.isInternal||c.series.push(E)});a&&u(["xAxis","yAxis"],function(b){u(I(a[b]),function(a,e){c[b][e]=p(c[b][e],a)})});d=
|
||||
new f.Chart(c,b.callback);u(["xAxis","yAxis"],function(a){u(b[a],function(b,e){e=d[a][e];var c=b.getExtremes();b=c.userMin;c=c.userMax;!e||void 0===b&&void 0===c||e.setExtremes(b,c,!0,!1)})});g=d.getChartHTML();c=null;d.destroy();B(e);n&&(e=g.match(/<\/svg>(.*?$)/))&&(e='\x3cforeignObject x\x3d"0" y\x3d"0" width\x3d"200" height\x3d"200"\x3e\x3cbody xmlns\x3d"http://www.w3.org/1999/xhtml"\x3e'+e[1]+"\x3c/body\x3e\x3c/foreignObject\x3e",g=g.replace("\x3c/svg\x3e",e+"\x3c/svg\x3e"));g=this.sanitizeSVG(g);
|
||||
return g=g.replace(/(url\(#highcharts-[0-9]+)"/g,"$1").replace(/"/g,"'")},getSVGForExport:function(a,b){var d=this.options.exporting;return this.getSVG(p({chart:{borderRadius:0}},d.chartOptions,b,{exporting:{sourceWidth:a&&a.sourceWidth||d.sourceWidth,sourceHeight:a&&a.sourceHeight||d.sourceHeight}}))},exportChart:function(a,b){b=this.getSVGForExport(a,b);a=p(this.options.exporting,a);f.post(a.url,{filename:a.filename||"chart",type:a.type,width:a.width||0,scale:a.scale,svg:b},a.formAttributes)},
|
||||
print:function(){var a=this,b=a.container,d=[],e=b.parentNode,g=v.body,f=g.childNodes,k=a.options.exporting.printMaxWidth,c,n;if(!a.isPrinting){a.isPrinting=!0;a.pointer.reset(null,0);G(a,"beforePrint");if(n=k&&a.chartWidth>k)c=[a.options.chart.width,void 0,!1],a.setSize(k,void 0,!1);u(f,function(a,b){1===a.nodeType&&(d[b]=a.style.display,a.style.display="none")});g.appendChild(b);z.focus();z.print();setTimeout(function(){e.appendChild(b);u(f,function(a,b){1===a.nodeType&&(a.style.display=d[b])});
|
||||
a.isPrinting=!1;n&&a.setSize.apply(a,c);G(a,"afterPrint")},1E3)}},contextMenu:function(a,b,d,e,g,f,k){var c=this,n=c.chartWidth,h=c.chartHeight,l="cache-"+a,m=c[l],r=Math.max(g,f),t,p,q=function(b){c.pointer.inClass(b.target,a)||p()};m||(c[l]=m=w("div",{className:a},{position:"absolute",zIndex:1E3,padding:r+"px"},c.container),t=w("div",{className:"highcharts-menu"},null,m),p=function(){H(m,{display:"none"});k&&k.setState(0);c.openMenu=!1},x(m,"mouseleave",function(){m.hideTimer=setTimeout(p,500)}),
|
||||
x(m,"mouseenter",function(){clearTimeout(m.hideTimer)}),x(v,"mouseup",q),x(c,"destroy",function(){F(v,"mouseup",q)}),u(b,function(a){if(a){var b;b=a.separator?w("hr",null,null,t):w("div",{className:"highcharts-menu-item",onclick:function(b){b&&b.stopPropagation();p();a.onclick&&a.onclick.apply(c,arguments)},innerHTML:a.text||c.options.lang[a.textKey]},null,t);c.exportDivElements.push(b)}}),c.exportDivElements.push(t,m),c.exportMenuWidth=m.offsetWidth,c.exportMenuHeight=m.offsetHeight);b={display:"block"};
|
||||
d+c.exportMenuWidth>n?b.right=n-d-g-r+"px":b.left=d-r+"px";e+f+c.exportMenuHeight>h&&"top"!==k.alignOptions.verticalAlign?b.bottom=h-e-r+"px":b.top=e+f-r+"px";H(m,b);c.openMenu=!0},addButton:function(a){var b=this,d=b.renderer,e=p(b.options.navigation.buttonOptions,a),g=e.onclick,f=e.menuItems,k,c,n=e.symbolSize||12;b.btnCount||(b.btnCount=0);b.exportDivElements||(b.exportDivElements=[],b.exportSVGElements=[]);if(!1!==e.enabled){var h=e.theme,l=h.states,m=l&&l.hover,l=l&&l.select,r;delete h.states;
|
||||
g?r=function(a){a.stopPropagation();g.call(b,a)}:f&&(r=function(){b.contextMenu(c.menuClassName,f,c.translateX,c.translateY,c.width,c.height,c);c.setState(2)});e.text&&e.symbol?h.paddingLeft=C(h.paddingLeft,25):e.text||y(h,{width:e.width,height:e.height,padding:0});c=d.button(e.text,0,0,r,h,m,l).addClass(a.className).attr({title:b.options.lang[e._titleKey],zIndex:3});c.menuClassName=a.menuClassName||"highcharts-menu-"+b.btnCount++;e.symbol&&(k=d.symbol(e.symbol,e.symbolX-n/2,e.symbolY-n/2,n,n).addClass("highcharts-button-symbol").attr({zIndex:1}).add(c));
|
||||
c.add().align(y(e,{width:c.width,x:C(e.x,b.buttonOffset)}),!0,"spacingBox");b.buttonOffset+=(c.width+e.buttonSpacing)*("right"===e.align?-1:1);b.exportSVGElements.push(c,k)}},destroyExport:function(a){var b=a?a.target:this;a=b.exportSVGElements;var d=b.exportDivElements;a&&(u(a,function(a,d){a&&(a.onclick=a.ontouchstart=null,b.exportSVGElements[d]=a.destroy())}),a.length=0);d&&(u(d,function(a,d){clearTimeout(a.hideTimer);F(a,"mouseleave");b.exportDivElements[d]=a.onmouseout=a.onmouseover=a.ontouchstart=
|
||||
a.onclick=null;B(a)}),d.length=0)}});D.prototype.inlineToAttributes="fill stroke strokeLinecap strokeLinejoin strokeWidth textAnchor x y".split(" ");D.prototype.inlineBlacklist=[/-/,/^(clipPath|cssText|d|height|width)$/,/^font$/,/[lL]ogical(Width|Height)$/,/perspective/,/TapHighlightColor/,/^transition/];D.prototype.unstyledElements=["clipPath","defs","desc"];A.prototype.inlineStyles=function(){function a(a){return a.replace(/([A-Z])/g,function(a,b){return"-"+b.toLowerCase()})}function b(d){var h,
|
||||
l,m,r="",t,n;if(1===d.nodeType&&-1===q.indexOf(d.nodeName)){l=z.getComputedStyle(d,null);m="svg"===d.nodeName?{}:z.getComputedStyle(d.parentNode,null);k[d.nodeName]||(c||(c=v.createElementNS(f.SVG_NS,"svg"),c.setAttribute("version","1.1"),v.body.appendChild(c)),t=v.createElementNS(d.namespaceURI,d.nodeName),c.appendChild(t),k[d.nodeName]=p(z.getComputedStyle(t,null)),c.removeChild(t));for(h in l){t=!1;for(n=g.length;n--&&!t;)t=g[n].test(h)||"function"===typeof l[h];t||m[h]!==l[h]&&k[d.nodeName][h]!==
|
||||
l[h]&&(-1!==e.indexOf(h)?d.setAttribute(a(h),l[h]):r+=a(h)+":"+l[h]+";")}r&&(h=d.getAttribute("style"),d.setAttribute("style",(h?h+";":"")+r));"text"!==d.nodeName&&u(d.children||d.childNodes,b)}}var d=this.renderer,e=d.inlineToAttributes,g=d.inlineBlacklist,q=d.unstyledElements,k={},c;b(this.container.querySelector("svg"));c.parentNode.removeChild(c)};J.menu=function(a,b,d,e){return["M",a,b+2.5,"L",a+d,b+2.5,"M",a,b+e/2+.5,"L",a+d,b+e/2+.5,"M",a,b+e-1.5,"L",a+d,b+e-1.5]};A.prototype.renderExporting=
|
||||
function(){var a,b=this.options.exporting,d=b.buttons,e=this.isDirtyExporting||!this.exportSVGElements;this.buttonOffset=0;this.isDirtyExporting&&this.destroyExport();if(e&&!1!==b.enabled){for(a in d)this.addButton(d[a]);this.isDirtyExporting=!1}x(this,"destroy",this.destroyExport)};A.prototype.callbacks.push(function(a){a.renderExporting();x(a,"redraw",a.renderExporting);u(["exporting","navigation"],function(b){a[b]={update:function(d,e){a.isDirtyExporting=!0;p(!0,a.options[b],d);C(e,!0)&&a.redraw()}}})})})(q)});
|
948
assets/plugin/chart/highcharts/code/js/modules/exporting.src.js
Executable file
948
assets/plugin/chart/highcharts/code/js/modules/exporting.src.js
Executable file
@ -0,0 +1,948 @@
|
||||
/**
|
||||
* @license Highcharts JS v5.0.2 (2016-10-26)
|
||||
* Exporting module
|
||||
*
|
||||
* (c) 2010-2016 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
(function(factory) {
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
module.exports = factory;
|
||||
} else {
|
||||
factory(Highcharts);
|
||||
}
|
||||
}(function(Highcharts) {
|
||||
(function(H) {
|
||||
/**
|
||||
* Exporting module
|
||||
*
|
||||
* (c) 2010-2016 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
|
||||
/* eslint indent:0 */
|
||||
'use strict';
|
||||
|
||||
// create shortcuts
|
||||
var defaultOptions = H.defaultOptions,
|
||||
doc = H.doc,
|
||||
Chart = H.Chart,
|
||||
addEvent = H.addEvent,
|
||||
removeEvent = H.removeEvent,
|
||||
fireEvent = H.fireEvent,
|
||||
createElement = H.createElement,
|
||||
discardElement = H.discardElement,
|
||||
css = H.css,
|
||||
merge = H.merge,
|
||||
pick = H.pick,
|
||||
each = H.each,
|
||||
extend = H.extend,
|
||||
splat = H.splat,
|
||||
isTouchDevice = H.isTouchDevice,
|
||||
win = H.win,
|
||||
SVGRenderer = H.SVGRenderer;
|
||||
|
||||
var symbols = H.Renderer.prototype.symbols;
|
||||
|
||||
// Add language
|
||||
extend(defaultOptions.lang, {
|
||||
printChart: 'Print chart',
|
||||
downloadPNG: 'Download PNG image',
|
||||
downloadJPEG: 'Download JPEG image',
|
||||
downloadPDF: 'Download PDF document',
|
||||
downloadSVG: 'Download SVG vector image',
|
||||
contextButtonTitle: 'Chart context menu'
|
||||
});
|
||||
|
||||
// Buttons and menus are collected in a separate config option set called 'navigation'.
|
||||
// This can be extended later to add control buttons like zoom and pan right click menus.
|
||||
defaultOptions.navigation = {
|
||||
buttonOptions: {
|
||||
theme: {},
|
||||
symbolSize: 14,
|
||||
symbolX: 12.5,
|
||||
symbolY: 10.5,
|
||||
align: 'right',
|
||||
buttonSpacing: 3,
|
||||
height: 22,
|
||||
// text: null,
|
||||
verticalAlign: 'top',
|
||||
width: 24
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// Add the export related options
|
||||
defaultOptions.exporting = {
|
||||
//enabled: true,
|
||||
//filename: 'chart',
|
||||
type: 'image/png',
|
||||
url: 'https://export.highcharts.com/',
|
||||
//width: undefined,
|
||||
printMaxWidth: 780,
|
||||
scale: 2,
|
||||
buttons: {
|
||||
contextButton: {
|
||||
className: 'highcharts-contextbutton',
|
||||
menuClassName: 'highcharts-contextmenu',
|
||||
//x: -10,
|
||||
symbol: 'menu',
|
||||
_titleKey: 'contextButtonTitle',
|
||||
menuItems: [{
|
||||
textKey: 'printChart',
|
||||
onclick: function() {
|
||||
this.print();
|
||||
}
|
||||
}, {
|
||||
separator: true
|
||||
}, {
|
||||
textKey: 'downloadPNG',
|
||||
onclick: function() {
|
||||
this.exportChart();
|
||||
}
|
||||
}, {
|
||||
textKey: 'downloadJPEG',
|
||||
onclick: function() {
|
||||
this.exportChart({
|
||||
type: 'image/jpeg'
|
||||
});
|
||||
}
|
||||
}, {
|
||||
textKey: 'downloadPDF',
|
||||
onclick: function() {
|
||||
this.exportChart({
|
||||
type: 'application/pdf'
|
||||
});
|
||||
}
|
||||
}, {
|
||||
textKey: 'downloadSVG',
|
||||
onclick: function() {
|
||||
this.exportChart({
|
||||
type: 'image/svg+xml'
|
||||
});
|
||||
}
|
||||
}
|
||||
// Enable this block to add "View SVG" to the dropdown menu
|
||||
/*
|
||||
,{
|
||||
|
||||
text: 'View SVG',
|
||||
onclick: function () {
|
||||
var svg = this.getSVG()
|
||||
.replace(/</g, '\n<')
|
||||
.replace(/>/g, '>');
|
||||
|
||||
doc.body.innerHTML = '<pre>' + svg + '</pre>';
|
||||
}
|
||||
} // */
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Add the H.post utility
|
||||
H.post = function(url, data, formAttributes) {
|
||||
var name,
|
||||
form;
|
||||
|
||||
// create the form
|
||||
form = createElement('form', merge({
|
||||
method: 'post',
|
||||
action: url,
|
||||
enctype: 'multipart/form-data'
|
||||
}, formAttributes), {
|
||||
display: 'none'
|
||||
}, doc.body);
|
||||
|
||||
// add the data
|
||||
for (name in data) {
|
||||
createElement('input', {
|
||||
type: 'hidden',
|
||||
name: name,
|
||||
value: data[name]
|
||||
}, null, form);
|
||||
}
|
||||
|
||||
// submit
|
||||
form.submit();
|
||||
|
||||
// clean up
|
||||
discardElement(form);
|
||||
};
|
||||
|
||||
extend(Chart.prototype, {
|
||||
|
||||
/**
|
||||
* A collection of regex fixes on the produces SVG to account for expando properties,
|
||||
* browser bugs, VML problems and other. Returns a cleaned SVG.
|
||||
*/
|
||||
sanitizeSVG: function(svg) {
|
||||
svg = svg
|
||||
.replace(/zIndex="[^"]+"/g, '')
|
||||
.replace(/isShadow="[^"]+"/g, '')
|
||||
.replace(/symbolName="[^"]+"/g, '')
|
||||
.replace(/jQuery[0-9]+="[^"]+"/g, '')
|
||||
.replace(/url\(("|")(\S+)("|")\)/g, 'url($2)')
|
||||
.replace(/url\([^#]+#/g, 'url(#')
|
||||
.replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
|
||||
.replace(/ (NS[0-9]+\:)?href=/g, ' xlink:href=') // #3567
|
||||
.replace(/\n/, ' ')
|
||||
// Any HTML added to the container after the SVG (#894)
|
||||
.replace(/<\/svg>.*?$/, '</svg>')
|
||||
// Batik doesn't support rgba fills and strokes (#3095)
|
||||
.replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g, '$1="rgb($2)" $1-opacity="$3"')
|
||||
/* This fails in IE < 8
|
||||
.replace(/([0-9]+)\.([0-9]+)/g, function(s1, s2, s3) { // round off to save weight
|
||||
return s2 +'.'+ s3[0];
|
||||
})*/
|
||||
|
||||
// Replace HTML entities, issue #347
|
||||
.replace(/ /g, '\u00A0') // no-break space
|
||||
.replace(/­/g, '\u00AD'); // soft hyphen
|
||||
|
||||
|
||||
|
||||
return svg;
|
||||
},
|
||||
|
||||
/**
|
||||
* Return innerHTML of chart. Used as hook for plugins.
|
||||
*/
|
||||
getChartHTML: function() {
|
||||
|
||||
this.inlineStyles();
|
||||
|
||||
return this.container.innerHTML;
|
||||
},
|
||||
|
||||
/**
|
||||
* Return an SVG representation of the chart
|
||||
*
|
||||
* @param additionalOptions {Object} Additional chart options for the generated SVG representation
|
||||
*/
|
||||
getSVG: function(additionalOptions) {
|
||||
var chart = this,
|
||||
chartCopy,
|
||||
sandbox,
|
||||
svg,
|
||||
seriesOptions,
|
||||
sourceWidth,
|
||||
sourceHeight,
|
||||
cssWidth,
|
||||
cssHeight,
|
||||
html,
|
||||
options = merge(chart.options, additionalOptions), // copy the options and add extra options
|
||||
allowHTML = options.exporting.allowHTML;
|
||||
|
||||
|
||||
// IE compatibility hack for generating SVG content that it doesn't really understand
|
||||
if (!doc.createElementNS) {
|
||||
doc.createElementNS = function(ns, tagName) {
|
||||
return doc.createElement(tagName);
|
||||
};
|
||||
}
|
||||
|
||||
// create a sandbox where a new chart will be generated
|
||||
sandbox = createElement('div', null, {
|
||||
position: 'absolute',
|
||||
top: '-9999em',
|
||||
width: chart.chartWidth + 'px',
|
||||
height: chart.chartHeight + 'px'
|
||||
}, doc.body);
|
||||
|
||||
// get the source size
|
||||
cssWidth = chart.renderTo.style.width;
|
||||
cssHeight = chart.renderTo.style.height;
|
||||
sourceWidth = options.exporting.sourceWidth ||
|
||||
options.chart.width ||
|
||||
(/px$/.test(cssWidth) && parseInt(cssWidth, 10)) ||
|
||||
600;
|
||||
sourceHeight = options.exporting.sourceHeight ||
|
||||
options.chart.height ||
|
||||
(/px$/.test(cssHeight) && parseInt(cssHeight, 10)) ||
|
||||
400;
|
||||
|
||||
// override some options
|
||||
extend(options.chart, {
|
||||
animation: false,
|
||||
renderTo: sandbox,
|
||||
forExport: true,
|
||||
renderer: 'SVGRenderer',
|
||||
width: sourceWidth,
|
||||
height: sourceHeight
|
||||
});
|
||||
options.exporting.enabled = false; // hide buttons in print
|
||||
delete options.data; // #3004
|
||||
|
||||
// prepare for replicating the chart
|
||||
options.series = [];
|
||||
each(chart.series, function(serie) {
|
||||
seriesOptions = merge(serie.userOptions, { // #4912
|
||||
animation: false, // turn off animation
|
||||
enableMouseTracking: false,
|
||||
showCheckbox: false,
|
||||
visible: serie.visible
|
||||
});
|
||||
|
||||
if (!seriesOptions.isInternal) { // used for the navigator series that has its own option set
|
||||
options.series.push(seriesOptions);
|
||||
}
|
||||
});
|
||||
|
||||
// Axis options must be merged in one by one, since it may be an array or an object (#2022, #3900)
|
||||
if (additionalOptions) {
|
||||
each(['xAxis', 'yAxis'], function(axisType) {
|
||||
each(splat(additionalOptions[axisType]), function(axisOptions, i) {
|
||||
options[axisType][i] = merge(options[axisType][i], axisOptions);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// generate the chart copy
|
||||
chartCopy = new H.Chart(options, chart.callback);
|
||||
|
||||
// reflect axis extremes in the export
|
||||
each(['xAxis', 'yAxis'], function(axisType) {
|
||||
each(chart[axisType], function(axis, i) {
|
||||
var axisCopy = chartCopy[axisType][i],
|
||||
extremes = axis.getExtremes(),
|
||||
userMin = extremes.userMin,
|
||||
userMax = extremes.userMax;
|
||||
|
||||
if (axisCopy && (userMin !== undefined || userMax !== undefined)) {
|
||||
axisCopy.setExtremes(userMin, userMax, true, false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// get the SVG from the container's innerHTML
|
||||
svg = chartCopy.getChartHTML();
|
||||
|
||||
// free up memory
|
||||
options = null;
|
||||
chartCopy.destroy();
|
||||
discardElement(sandbox);
|
||||
|
||||
// Move HTML into a foreignObject
|
||||
if (allowHTML) {
|
||||
html = svg.match(/<\/svg>(.*?$)/);
|
||||
if (html) {
|
||||
html = '<foreignObject x="0" y="0" width="200" height="200">' +
|
||||
'<body xmlns="http://www.w3.org/1999/xhtml">' +
|
||||
html[1] +
|
||||
'</body>' +
|
||||
'</foreignObject>';
|
||||
svg = svg.replace('</svg>', html + '</svg>');
|
||||
}
|
||||
}
|
||||
|
||||
// sanitize
|
||||
svg = this.sanitizeSVG(svg);
|
||||
|
||||
// IE9 beta bugs with innerHTML. Test again with final IE9.
|
||||
svg = svg.replace(/(url\(#highcharts-[0-9]+)"/g, '$1')
|
||||
.replace(/"/g, '\'');
|
||||
|
||||
return svg;
|
||||
},
|
||||
|
||||
getSVGForExport: function(options, chartOptions) {
|
||||
var chartExportingOptions = this.options.exporting;
|
||||
|
||||
return this.getSVG(merge({
|
||||
chart: {
|
||||
borderRadius: 0
|
||||
}
|
||||
},
|
||||
chartExportingOptions.chartOptions,
|
||||
chartOptions, {
|
||||
exporting: {
|
||||
sourceWidth: (options && options.sourceWidth) || chartExportingOptions.sourceWidth,
|
||||
sourceHeight: (options && options.sourceHeight) || chartExportingOptions.sourceHeight
|
||||
}
|
||||
}
|
||||
));
|
||||
},
|
||||
|
||||
/**
|
||||
* Submit the SVG representation of the chart to the server
|
||||
* @param {Object} options Exporting options. Possible members are url, type, width and formAttributes.
|
||||
* @param {Object} chartOptions Additional chart options for the SVG representation of the chart
|
||||
*/
|
||||
exportChart: function(options, chartOptions) {
|
||||
|
||||
var svg = this.getSVGForExport(options, chartOptions);
|
||||
|
||||
// merge the options
|
||||
options = merge(this.options.exporting, options);
|
||||
|
||||
// do the post
|
||||
H.post(options.url, {
|
||||
filename: options.filename || 'chart',
|
||||
type: options.type,
|
||||
width: options.width || 0, // IE8 fails to post undefined correctly, so use 0
|
||||
scale: options.scale,
|
||||
svg: svg
|
||||
}, options.formAttributes);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Print the chart
|
||||
*/
|
||||
print: function() {
|
||||
|
||||
var chart = this,
|
||||
container = chart.container,
|
||||
origDisplay = [],
|
||||
origParent = container.parentNode,
|
||||
body = doc.body,
|
||||
childNodes = body.childNodes,
|
||||
printMaxWidth = chart.options.exporting.printMaxWidth,
|
||||
resetParams,
|
||||
handleMaxWidth;
|
||||
|
||||
if (chart.isPrinting) { // block the button while in printing mode
|
||||
return;
|
||||
}
|
||||
|
||||
chart.isPrinting = true;
|
||||
chart.pointer.reset(null, 0);
|
||||
|
||||
fireEvent(chart, 'beforePrint');
|
||||
|
||||
// Handle printMaxWidth
|
||||
handleMaxWidth = printMaxWidth && chart.chartWidth > printMaxWidth;
|
||||
if (handleMaxWidth) {
|
||||
resetParams = [chart.options.chart.width, undefined, false];
|
||||
chart.setSize(printMaxWidth, undefined, false);
|
||||
}
|
||||
|
||||
// hide all body content
|
||||
each(childNodes, function(node, i) {
|
||||
if (node.nodeType === 1) {
|
||||
origDisplay[i] = node.style.display;
|
||||
node.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// pull out the chart
|
||||
body.appendChild(container);
|
||||
|
||||
// print
|
||||
win.focus(); // #1510
|
||||
win.print();
|
||||
|
||||
// allow the browser to prepare before reverting
|
||||
setTimeout(function() {
|
||||
|
||||
// put the chart back in
|
||||
origParent.appendChild(container);
|
||||
|
||||
// restore all body content
|
||||
each(childNodes, function(node, i) {
|
||||
if (node.nodeType === 1) {
|
||||
node.style.display = origDisplay[i];
|
||||
}
|
||||
});
|
||||
|
||||
chart.isPrinting = false;
|
||||
|
||||
// Reset printMaxWidth
|
||||
if (handleMaxWidth) {
|
||||
chart.setSize.apply(chart, resetParams);
|
||||
}
|
||||
|
||||
fireEvent(chart, 'afterPrint');
|
||||
|
||||
}, 1000);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Display a popup menu for choosing the export type
|
||||
*
|
||||
* @param {String} className An identifier for the menu
|
||||
* @param {Array} items A collection with text and onclicks for the items
|
||||
* @param {Number} x The x position of the opener button
|
||||
* @param {Number} y The y position of the opener button
|
||||
* @param {Number} width The width of the opener button
|
||||
* @param {Number} height The height of the opener button
|
||||
*/
|
||||
contextMenu: function(className, items, x, y, width, height, button) {
|
||||
var chart = this,
|
||||
navOptions = chart.options.navigation,
|
||||
chartWidth = chart.chartWidth,
|
||||
chartHeight = chart.chartHeight,
|
||||
cacheName = 'cache-' + className,
|
||||
menu = chart[cacheName],
|
||||
menuPadding = Math.max(width, height), // for mouse leave detection
|
||||
innerMenu,
|
||||
hide,
|
||||
menuStyle,
|
||||
docMouseUpHandler = function(e) {
|
||||
if (!chart.pointer.inClass(e.target, className)) {
|
||||
hide();
|
||||
}
|
||||
};
|
||||
|
||||
// create the menu only the first time
|
||||
if (!menu) {
|
||||
|
||||
// create a HTML element above the SVG
|
||||
chart[cacheName] = menu = createElement('div', {
|
||||
className: className
|
||||
}, {
|
||||
position: 'absolute',
|
||||
zIndex: 1000,
|
||||
padding: menuPadding + 'px'
|
||||
}, chart.container);
|
||||
|
||||
innerMenu = createElement('div', {
|
||||
className: 'highcharts-menu'
|
||||
}, null, menu);
|
||||
|
||||
|
||||
|
||||
// hide on mouse out
|
||||
hide = function() {
|
||||
css(menu, {
|
||||
display: 'none'
|
||||
});
|
||||
if (button) {
|
||||
button.setState(0);
|
||||
}
|
||||
chart.openMenu = false;
|
||||
};
|
||||
|
||||
// Hide the menu some time after mouse leave (#1357)
|
||||
addEvent(menu, 'mouseleave', function() {
|
||||
menu.hideTimer = setTimeout(hide, 500);
|
||||
});
|
||||
addEvent(menu, 'mouseenter', function() {
|
||||
clearTimeout(menu.hideTimer);
|
||||
});
|
||||
|
||||
|
||||
// Hide it on clicking or touching outside the menu (#2258, #2335, #2407)
|
||||
addEvent(doc, 'mouseup', docMouseUpHandler);
|
||||
addEvent(chart, 'destroy', function() {
|
||||
removeEvent(doc, 'mouseup', docMouseUpHandler);
|
||||
});
|
||||
|
||||
|
||||
// create the items
|
||||
each(items, function(item) {
|
||||
if (item) {
|
||||
var element;
|
||||
|
||||
if (item.separator) {
|
||||
element = createElement('hr', null, null, innerMenu);
|
||||
|
||||
} else {
|
||||
element = createElement('div', {
|
||||
className: 'highcharts-menu-item',
|
||||
onclick: function(e) {
|
||||
if (e) { // IE7
|
||||
e.stopPropagation();
|
||||
}
|
||||
hide();
|
||||
if (item.onclick) {
|
||||
item.onclick.apply(chart, arguments);
|
||||
}
|
||||
},
|
||||
innerHTML: item.text || chart.options.lang[item.textKey]
|
||||
}, null, innerMenu);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Keep references to menu divs to be able to destroy them
|
||||
chart.exportDivElements.push(element);
|
||||
}
|
||||
});
|
||||
|
||||
// Keep references to menu and innerMenu div to be able to destroy them
|
||||
chart.exportDivElements.push(innerMenu, menu);
|
||||
|
||||
chart.exportMenuWidth = menu.offsetWidth;
|
||||
chart.exportMenuHeight = menu.offsetHeight;
|
||||
}
|
||||
|
||||
menuStyle = {
|
||||
display: 'block'
|
||||
};
|
||||
|
||||
// if outside right, right align it
|
||||
if (x + chart.exportMenuWidth > chartWidth) {
|
||||
menuStyle.right = (chartWidth - x - width - menuPadding) + 'px';
|
||||
} else {
|
||||
menuStyle.left = (x - menuPadding) + 'px';
|
||||
}
|
||||
// if outside bottom, bottom align it
|
||||
if (y + height + chart.exportMenuHeight > chartHeight && button.alignOptions.verticalAlign !== 'top') {
|
||||
menuStyle.bottom = (chartHeight - y - menuPadding) + 'px';
|
||||
} else {
|
||||
menuStyle.top = (y + height - menuPadding) + 'px';
|
||||
}
|
||||
|
||||
css(menu, menuStyle);
|
||||
chart.openMenu = true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Add the export button to the chart
|
||||
*/
|
||||
addButton: function(options) {
|
||||
var chart = this,
|
||||
renderer = chart.renderer,
|
||||
btnOptions = merge(chart.options.navigation.buttonOptions, options),
|
||||
onclick = btnOptions.onclick,
|
||||
menuItems = btnOptions.menuItems,
|
||||
symbol,
|
||||
button,
|
||||
symbolSize = btnOptions.symbolSize || 12;
|
||||
if (!chart.btnCount) {
|
||||
chart.btnCount = 0;
|
||||
}
|
||||
|
||||
// Keeps references to the button elements
|
||||
if (!chart.exportDivElements) {
|
||||
chart.exportDivElements = [];
|
||||
chart.exportSVGElements = [];
|
||||
}
|
||||
|
||||
if (btnOptions.enabled === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var attr = btnOptions.theme,
|
||||
states = attr.states,
|
||||
hover = states && states.hover,
|
||||
select = states && states.select,
|
||||
callback;
|
||||
|
||||
delete attr.states;
|
||||
|
||||
if (onclick) {
|
||||
callback = function(e) {
|
||||
e.stopPropagation();
|
||||
onclick.call(chart, e);
|
||||
};
|
||||
|
||||
} else if (menuItems) {
|
||||
callback = function() {
|
||||
chart.contextMenu(
|
||||
button.menuClassName,
|
||||
menuItems,
|
||||
button.translateX,
|
||||
button.translateY,
|
||||
button.width,
|
||||
button.height,
|
||||
button
|
||||
);
|
||||
button.setState(2);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (btnOptions.text && btnOptions.symbol) {
|
||||
attr.paddingLeft = pick(attr.paddingLeft, 25);
|
||||
|
||||
} else if (!btnOptions.text) {
|
||||
extend(attr, {
|
||||
width: btnOptions.width,
|
||||
height: btnOptions.height,
|
||||
padding: 0
|
||||
});
|
||||
}
|
||||
|
||||
button = renderer.button(btnOptions.text, 0, 0, callback, attr, hover, select)
|
||||
.addClass(options.className)
|
||||
.attr({
|
||||
|
||||
title: chart.options.lang[btnOptions._titleKey],
|
||||
zIndex: 3 // #4955
|
||||
});
|
||||
button.menuClassName = options.menuClassName || 'highcharts-menu-' + chart.btnCount++;
|
||||
|
||||
if (btnOptions.symbol) {
|
||||
symbol = renderer.symbol(
|
||||
btnOptions.symbol,
|
||||
btnOptions.symbolX - (symbolSize / 2),
|
||||
btnOptions.symbolY - (symbolSize / 2),
|
||||
symbolSize,
|
||||
symbolSize
|
||||
)
|
||||
.addClass('highcharts-button-symbol')
|
||||
.attr({
|
||||
zIndex: 1
|
||||
}).add(button);
|
||||
|
||||
|
||||
}
|
||||
|
||||
button.add()
|
||||
.align(extend(btnOptions, {
|
||||
width: button.width,
|
||||
x: pick(btnOptions.x, chart.buttonOffset) // #1654
|
||||
}), true, 'spacingBox');
|
||||
|
||||
chart.buttonOffset += (button.width + btnOptions.buttonSpacing) * (btnOptions.align === 'right' ? -1 : 1);
|
||||
|
||||
chart.exportSVGElements.push(button, symbol);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroy the buttons.
|
||||
*/
|
||||
destroyExport: function(e) {
|
||||
var chart = e ? e.target : this,
|
||||
exportSVGElements = chart.exportSVGElements,
|
||||
exportDivElements = chart.exportDivElements;
|
||||
|
||||
// Destroy the extra buttons added
|
||||
if (exportSVGElements) {
|
||||
each(exportSVGElements, function(elem, i) {
|
||||
|
||||
// Destroy and null the svg/vml elements
|
||||
if (elem) { // #1822
|
||||
elem.onclick = elem.ontouchstart = null;
|
||||
chart.exportSVGElements[i] = elem.destroy();
|
||||
}
|
||||
});
|
||||
exportSVGElements.length = 0;
|
||||
}
|
||||
|
||||
// Destroy the divs for the menu
|
||||
if (exportDivElements) {
|
||||
each(exportDivElements, function(elem, i) {
|
||||
|
||||
// Remove the event handler
|
||||
clearTimeout(elem.hideTimer); // #5427
|
||||
removeEvent(elem, 'mouseleave');
|
||||
|
||||
// Remove inline events
|
||||
chart.exportDivElements[i] = elem.onmouseout = elem.onmouseover = elem.ontouchstart = elem.onclick = null;
|
||||
|
||||
// Destroy the div by moving to garbage bin
|
||||
discardElement(elem);
|
||||
});
|
||||
exportDivElements.length = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// These ones are translated to attributes rather than styles
|
||||
SVGRenderer.prototype.inlineToAttributes = [
|
||||
'fill',
|
||||
'stroke',
|
||||
'strokeLinecap',
|
||||
'strokeLinejoin',
|
||||
'strokeWidth',
|
||||
'textAnchor',
|
||||
'x',
|
||||
'y'
|
||||
];
|
||||
// These CSS properties are not inlined. Remember camelCase.
|
||||
SVGRenderer.prototype.inlineBlacklist = [
|
||||
/-/, // In Firefox, both hyphened and camelCased names are listed
|
||||
/^(clipPath|cssText|d|height|width)$/, // Full words
|
||||
/^font$/, // more specific props are set
|
||||
/[lL]ogical(Width|Height)$/,
|
||||
/perspective/,
|
||||
/TapHighlightColor/,
|
||||
/^transition/
|
||||
// /^text (border|color|cursor|height|webkitBorder)/
|
||||
];
|
||||
SVGRenderer.prototype.unstyledElements = [
|
||||
'clipPath',
|
||||
'defs',
|
||||
'desc'
|
||||
];
|
||||
|
||||
/**
|
||||
* Analyze inherited styles from stylesheets and add them inline
|
||||
*
|
||||
* @todo: What are the border styles for text about? In general, text has a lot of properties.
|
||||
* @todo: Make it work with IE9 and IE10.
|
||||
*/
|
||||
Chart.prototype.inlineStyles = function() {
|
||||
var renderer = this.renderer,
|
||||
inlineToAttributes = renderer.inlineToAttributes,
|
||||
blacklist = renderer.inlineBlacklist,
|
||||
unstyledElements = renderer.unstyledElements,
|
||||
defaultStyles = {},
|
||||
dummySVG;
|
||||
|
||||
/**
|
||||
* Make hyphenated property names out of camelCase
|
||||
*/
|
||||
function hyphenate(prop) {
|
||||
return prop.replace(
|
||||
/([A-Z])/g,
|
||||
function(a, b) {
|
||||
return '-' + b.toLowerCase();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this on all elements and recurse to children
|
||||
*/
|
||||
function recurse(node) {
|
||||
var prop,
|
||||
styles,
|
||||
parentStyles,
|
||||
cssText = '',
|
||||
dummy,
|
||||
styleAttr,
|
||||
blacklisted,
|
||||
i;
|
||||
|
||||
if (node.nodeType === 1 && unstyledElements.indexOf(node.nodeName) === -1) {
|
||||
styles = win.getComputedStyle(node, null);
|
||||
parentStyles = node.nodeName === 'svg' ? {} : win.getComputedStyle(node.parentNode, null);
|
||||
|
||||
// Get default styles from the browser so that we don't have to add these
|
||||
if (!defaultStyles[node.nodeName]) {
|
||||
if (!dummySVG) {
|
||||
dummySVG = doc.createElementNS(H.SVG_NS, 'svg');
|
||||
dummySVG.setAttribute('version', '1.1');
|
||||
doc.body.appendChild(dummySVG);
|
||||
}
|
||||
dummy = doc.createElementNS(node.namespaceURI, node.nodeName);
|
||||
dummySVG.appendChild(dummy);
|
||||
defaultStyles[node.nodeName] = merge(win.getComputedStyle(dummy, null)); // Copy, so we can remove the node
|
||||
dummySVG.removeChild(dummy);
|
||||
}
|
||||
|
||||
// Loop over all the computed styles and check whether they are in the
|
||||
// white list for styles or atttributes.
|
||||
for (prop in styles) {
|
||||
|
||||
// Check against blacklist
|
||||
blacklisted = false;
|
||||
i = blacklist.length;
|
||||
while (i-- && !blacklisted) {
|
||||
blacklisted = blacklist[i].test(prop) || typeof styles[prop] === 'function';
|
||||
}
|
||||
|
||||
if (!blacklisted) {
|
||||
|
||||
// If parent node has the same style, it gets inherited, no need to inline it
|
||||
if (parentStyles[prop] !== styles[prop] && defaultStyles[node.nodeName][prop] !== styles[prop]) {
|
||||
|
||||
// Attributes
|
||||
if (inlineToAttributes.indexOf(prop) !== -1) {
|
||||
node.setAttribute(hyphenate(prop), styles[prop]);
|
||||
|
||||
// Styles
|
||||
} else {
|
||||
cssText += hyphenate(prop) + ':' + styles[prop] + ';';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Apply styles
|
||||
if (cssText) {
|
||||
styleAttr = node.getAttribute('style');
|
||||
node.setAttribute('style', (styleAttr ? styleAttr + ';' : '') + cssText);
|
||||
}
|
||||
|
||||
if (node.nodeName === 'text') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Recurse
|
||||
each(node.children || node.childNodes, recurse);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the dummy objects used to get defaults
|
||||
*/
|
||||
function tearDown() {
|
||||
dummySVG.parentNode.removeChild(dummySVG);
|
||||
}
|
||||
|
||||
recurse(this.container.querySelector('svg'));
|
||||
tearDown();
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
symbols.menu = function(x, y, width, height) {
|
||||
var arr = [
|
||||
'M', x, y + 2.5,
|
||||
'L', x + width, y + 2.5,
|
||||
'M', x, y + height / 2 + 0.5,
|
||||
'L', x + width, y + height / 2 + 0.5,
|
||||
'M', x, y + height - 1.5,
|
||||
'L', x + width, y + height - 1.5
|
||||
];
|
||||
return arr;
|
||||
};
|
||||
|
||||
// Add the buttons on chart load
|
||||
Chart.prototype.renderExporting = function() {
|
||||
var n,
|
||||
exportingOptions = this.options.exporting,
|
||||
buttons = exportingOptions.buttons,
|
||||
isDirty = this.isDirtyExporting || !this.exportSVGElements;
|
||||
|
||||
this.buttonOffset = 0;
|
||||
if (this.isDirtyExporting) {
|
||||
this.destroyExport();
|
||||
}
|
||||
|
||||
if (isDirty && exportingOptions.enabled !== false) {
|
||||
|
||||
for (n in buttons) {
|
||||
this.addButton(buttons[n]);
|
||||
}
|
||||
|
||||
this.isDirtyExporting = false;
|
||||
}
|
||||
|
||||
// Destroy the export elements at chart destroy
|
||||
addEvent(this, 'destroy', this.destroyExport);
|
||||
};
|
||||
|
||||
Chart.prototype.callbacks.push(function(chart) {
|
||||
|
||||
function update(prop, options, redraw) {
|
||||
chart.isDirtyExporting = true;
|
||||
merge(true, chart.options[prop], options);
|
||||
if (pick(redraw, true)) {
|
||||
chart.redraw();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
chart.renderExporting();
|
||||
|
||||
addEvent(chart, 'redraw', chart.renderExporting);
|
||||
|
||||
// Add update methods to handle chart.update and chart.exporting.update
|
||||
// and chart.navigation.update.
|
||||
each(['exporting', 'navigation'], function(prop) {
|
||||
chart[prop] = {
|
||||
update: function(options, redraw) {
|
||||
update(prop, options, redraw);
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
}(Highcharts));
|
||||
}));
|
12
assets/plugin/chart/highcharts/code/js/modules/funnel.js
Executable file
12
assets/plugin/chart/highcharts/code/js/modules/funnel.js
Executable file
@ -0,0 +1,12 @@
|
||||
/*
|
||||
Highcharts JS v5.0.2 (2016-10-26)
|
||||
Highcharts funnel module
|
||||
|
||||
(c) 2010-2016 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(c){"object"===typeof module&&module.exports?module.exports=c:c(Highcharts)})(function(c){(function(c){var n=c.seriesType,z=c.seriesTypes,F=c.noop,G=c.each;n("funnel","pie",{animation:!1,center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",reversed:!1,size:!0},{animate:F,translate:function(){var b=function(a,b){return/%$/.test(a)?b*parseInt(a,10)/100:parseInt(a,10)},c=0,e=this.chart,d=this.options,r=d.reversed,H=d.ignoreHiddenPoint,t=e.plotWidth,e=e.plotHeight,
|
||||
p=0,n=d.center,f=b(n[0],t),q=b(n[1],e),z=b(d.width,t),h,v,k=b(d.height,e),w=b(d.neckWidth,t),D=b(d.neckHeight,e),x=q-k/2+k-D,b=this.data,A,B,I="left"===d.dataLabels.position?1:0,C,l,E,u,g,y,m;this.getWidthAt=v=function(a){var b=q-k/2;return a>x||k===D?w:w+(z-w)*(1-(a-b)/(k-D))};this.getX=function(a,b){return f+(b?-1:1)*(v(r?2*q-a:a)/2+d.dataLabels.distance)};this.center=[f,q,k];this.centerX=f;G(b,function(a){H&&!1===a.visible||(c+=a.y)});G(b,function(a){m=null;B=c?a.y/c:0;l=q-k/2+p*k;g=l+B*k;h=v(l);
|
||||
C=f-h/2;E=C+h;h=v(g);u=f-h/2;y=u+h;l>x?(C=u=f-w/2,E=y=f+w/2):g>x&&(m=g,h=v(x),u=f-h/2,y=u+h,g=x);r&&(l=2*q-l,g=2*q-g,m=m?2*q-m:null);A=["M",C,l,"L",E,l,y,g];m&&A.push(y,m,u,m);A.push(u,g,"Z");a.shapeType="path";a.shapeArgs={d:A};a.percentage=100*B;a.plotX=f;a.plotY=(l+(m||g))/2;a.tooltipPos=[f,a.plotY];a.slice=F;a.half=I;H&&!1===a.visible||(p+=B)})},drawPoints:z.column.prototype.drawPoints,sortByAngle:function(b){b.sort(function(b,c){return b.plotY-c.plotY})},drawDataLabels:function(){var b=this.data,
|
||||
c=this.options.dataLabels.distance,e,d,r,n=b.length,t,p;for(this.center[2]-=2*c;n--;)r=b[n],d=(e=r.half)?1:-1,p=r.plotY,t=this.getX(p,e),r.labelPos=[0,p,t+(c-5)*d,p,t+c*d,p,e?"right":"left",0];z.pie.prototype.drawDataLabels.call(this)}});n("pyramid","funnel",{neckWidth:"0%",neckHeight:"0%",reversed:!0})})(c)});
|
290
assets/plugin/chart/highcharts/code/js/modules/funnel.src.js
Executable file
290
assets/plugin/chart/highcharts/code/js/modules/funnel.src.js
Executable file
@ -0,0 +1,290 @@
|
||||
/**
|
||||
* @license Highcharts JS v5.0.2 (2016-10-26)
|
||||
* Highcharts funnel module
|
||||
*
|
||||
* (c) 2010-2016 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
(function(factory) {
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
module.exports = factory;
|
||||
} else {
|
||||
factory(Highcharts);
|
||||
}
|
||||
}(function(Highcharts) {
|
||||
(function(Highcharts) {
|
||||
/**
|
||||
* Highcharts funnel module
|
||||
*
|
||||
* (c) 2010-2016 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
/* eslint indent:0 */
|
||||
'use strict';
|
||||
|
||||
// create shortcuts
|
||||
var seriesType = Highcharts.seriesType,
|
||||
seriesTypes = Highcharts.seriesTypes,
|
||||
noop = Highcharts.noop,
|
||||
each = Highcharts.each;
|
||||
|
||||
|
||||
seriesType('funnel', 'pie', {
|
||||
animation: false,
|
||||
center: ['50%', '50%'],
|
||||
width: '90%',
|
||||
neckWidth: '30%',
|
||||
height: '100%',
|
||||
neckHeight: '25%',
|
||||
reversed: false,
|
||||
size: true, // to avoid adapting to data label size in Pie.drawDataLabels
|
||||
|
||||
|
||||
},
|
||||
|
||||
// Properties
|
||||
{
|
||||
animate: noop,
|
||||
|
||||
/**
|
||||
* Overrides the pie translate method
|
||||
*/
|
||||
translate: function() {
|
||||
|
||||
var
|
||||
// Get positions - either an integer or a percentage string must be given
|
||||
getLength = function(length, relativeTo) {
|
||||
return (/%$/).test(length) ?
|
||||
relativeTo * parseInt(length, 10) / 100 :
|
||||
parseInt(length, 10);
|
||||
},
|
||||
|
||||
sum = 0,
|
||||
series = this,
|
||||
chart = series.chart,
|
||||
options = series.options,
|
||||
reversed = options.reversed,
|
||||
ignoreHiddenPoint = options.ignoreHiddenPoint,
|
||||
plotWidth = chart.plotWidth,
|
||||
plotHeight = chart.plotHeight,
|
||||
cumulative = 0, // start at top
|
||||
center = options.center,
|
||||
centerX = getLength(center[0], plotWidth),
|
||||
centerY = getLength(center[1], plotHeight),
|
||||
width = getLength(options.width, plotWidth),
|
||||
tempWidth,
|
||||
getWidthAt,
|
||||
height = getLength(options.height, plotHeight),
|
||||
neckWidth = getLength(options.neckWidth, plotWidth),
|
||||
neckHeight = getLength(options.neckHeight, plotHeight),
|
||||
neckY = (centerY - height / 2) + height - neckHeight,
|
||||
data = series.data,
|
||||
path,
|
||||
fraction,
|
||||
half = options.dataLabels.position === 'left' ? 1 : 0,
|
||||
|
||||
x1,
|
||||
y1,
|
||||
x2,
|
||||
x3,
|
||||
y3,
|
||||
x4,
|
||||
y5;
|
||||
|
||||
// Return the width at a specific y coordinate
|
||||
series.getWidthAt = getWidthAt = function(y) {
|
||||
var top = (centerY - height / 2);
|
||||
|
||||
return y > neckY || height === neckHeight ?
|
||||
neckWidth :
|
||||
neckWidth + (width - neckWidth) * (1 - (y - top) / (height - neckHeight));
|
||||
};
|
||||
series.getX = function(y, half) {
|
||||
return centerX + (half ? -1 : 1) * ((getWidthAt(reversed ? 2 * centerY - y : y) / 2) + options.dataLabels.distance);
|
||||
};
|
||||
|
||||
// Expose
|
||||
series.center = [centerX, centerY, height];
|
||||
series.centerX = centerX;
|
||||
|
||||
/*
|
||||
* Individual point coordinate naming:
|
||||
*
|
||||
* x1,y1 _________________ x2,y1
|
||||
* \ /
|
||||
* \ /
|
||||
* \ /
|
||||
* \ /
|
||||
* \ /
|
||||
* x3,y3 _________ x4,y3
|
||||
*
|
||||
* Additional for the base of the neck:
|
||||
*
|
||||
* | |
|
||||
* | |
|
||||
* | |
|
||||
* x3,y5 _________ x4,y5
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
// get the total sum
|
||||
each(data, function(point) {
|
||||
if (!ignoreHiddenPoint || point.visible !== false) {
|
||||
sum += point.y;
|
||||
}
|
||||
});
|
||||
|
||||
each(data, function(point) {
|
||||
// set start and end positions
|
||||
y5 = null;
|
||||
fraction = sum ? point.y / sum : 0;
|
||||
y1 = centerY - height / 2 + cumulative * height;
|
||||
y3 = y1 + fraction * height;
|
||||
//tempWidth = neckWidth + (width - neckWidth) * ((height - neckHeight - y1) / (height - neckHeight));
|
||||
tempWidth = getWidthAt(y1);
|
||||
x1 = centerX - tempWidth / 2;
|
||||
x2 = x1 + tempWidth;
|
||||
tempWidth = getWidthAt(y3);
|
||||
x3 = centerX - tempWidth / 2;
|
||||
x4 = x3 + tempWidth;
|
||||
|
||||
// the entire point is within the neck
|
||||
if (y1 > neckY) {
|
||||
x1 = x3 = centerX - neckWidth / 2;
|
||||
x2 = x4 = centerX + neckWidth / 2;
|
||||
|
||||
// the base of the neck
|
||||
} else if (y3 > neckY) {
|
||||
y5 = y3;
|
||||
|
||||
tempWidth = getWidthAt(neckY);
|
||||
x3 = centerX - tempWidth / 2;
|
||||
x4 = x3 + tempWidth;
|
||||
|
||||
y3 = neckY;
|
||||
}
|
||||
|
||||
if (reversed) {
|
||||
y1 = 2 * centerY - y1;
|
||||
y3 = 2 * centerY - y3;
|
||||
y5 = (y5 ? 2 * centerY - y5 : null);
|
||||
}
|
||||
// save the path
|
||||
path = [
|
||||
'M',
|
||||
x1, y1,
|
||||
'L',
|
||||
x2, y1,
|
||||
x4, y3
|
||||
];
|
||||
if (y5) {
|
||||
path.push(x4, y5, x3, y5);
|
||||
}
|
||||
path.push(x3, y3, 'Z');
|
||||
|
||||
// prepare for using shared dr
|
||||
point.shapeType = 'path';
|
||||
point.shapeArgs = {
|
||||
d: path
|
||||
};
|
||||
|
||||
|
||||
// for tooltips and data labels
|
||||
point.percentage = fraction * 100;
|
||||
point.plotX = centerX;
|
||||
point.plotY = (y1 + (y5 || y3)) / 2;
|
||||
|
||||
// Placement of tooltips and data labels
|
||||
point.tooltipPos = [
|
||||
centerX,
|
||||
point.plotY
|
||||
];
|
||||
|
||||
// Slice is a noop on funnel points
|
||||
point.slice = noop;
|
||||
|
||||
// Mimicking pie data label placement logic
|
||||
point.half = half;
|
||||
|
||||
if (!ignoreHiddenPoint || point.visible !== false) {
|
||||
cumulative += fraction;
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Draw a single point (wedge)
|
||||
* @param {Object} point The point object
|
||||
* @param {Object} color The color of the point
|
||||
* @param {Number} brightness The brightness relative to the color
|
||||
*/
|
||||
drawPoints: seriesTypes.column.prototype.drawPoints,
|
||||
|
||||
/**
|
||||
* Funnel items don't have angles (#2289)
|
||||
*/
|
||||
sortByAngle: function(points) {
|
||||
points.sort(function(a, b) {
|
||||
return a.plotY - b.plotY;
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Extend the pie data label method
|
||||
*/
|
||||
drawDataLabels: function() {
|
||||
var data = this.data,
|
||||
labelDistance = this.options.dataLabels.distance,
|
||||
leftSide,
|
||||
sign,
|
||||
point,
|
||||
i = data.length,
|
||||
x,
|
||||
y;
|
||||
|
||||
// In the original pie label anticollision logic, the slots are distributed
|
||||
// from one labelDistance above to one labelDistance below the pie. In funnels
|
||||
// we don't want this.
|
||||
this.center[2] -= 2 * labelDistance;
|
||||
|
||||
// Set the label position array for each point.
|
||||
while (i--) {
|
||||
point = data[i];
|
||||
leftSide = point.half;
|
||||
sign = leftSide ? 1 : -1;
|
||||
y = point.plotY;
|
||||
x = this.getX(y, leftSide);
|
||||
|
||||
// set the anchor point for data labels
|
||||
point.labelPos = [
|
||||
0, // first break of connector
|
||||
y, // a/a
|
||||
x + (labelDistance - 5) * sign, // second break, right outside point shape
|
||||
y, // a/a
|
||||
x + labelDistance * sign, // landing point for connector
|
||||
y, // a/a
|
||||
leftSide ? 'right' : 'left', // alignment
|
||||
0 // center angle
|
||||
];
|
||||
}
|
||||
|
||||
seriesTypes.pie.prototype.drawDataLabels.call(this);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Pyramid series type.
|
||||
* A pyramid series is a special type of funnel, without neck and reversed by default.
|
||||
*/
|
||||
seriesType('pyramid', 'funnel', {
|
||||
neckWidth: '0%',
|
||||
neckHeight: '0%',
|
||||
reversed: true
|
||||
});
|
||||
|
||||
}(Highcharts));
|
||||
}));
|
24
assets/plugin/chart/highcharts/code/js/modules/gantt.js
Executable file
24
assets/plugin/chart/highcharts/code/js/modules/gantt.js
Executable file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
Highcharts JS v5.0.2 (2016-10-26)
|
||||
Gantt series
|
||||
|
||||
(c) 2016 Lars A. V. Cabrera
|
||||
|
||||
--- WORK IN PROGRESS ---
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(m){"object"===typeof module&&module.exports?module.exports=m:m(Highcharts)})(function(m){(function(c){var m=c.dateFormat,p=c.each,q=c.isObject,u=c.pick,l=c.wrap,n=c.Axis,v=c.Chart,r=c.Tick;n.prototype.isOuterAxis=function(){var a=this,f=-1,b=!0;p(this.chart.axes,function(d,g){d.side===a.side&&(d===a?f=g:0<=f&&g>f&&(b=!1))});return b};r.prototype.getLabelWidth=function(){return this.label.getBBox().width};n.prototype.getMaxLabelLength=function(a){var f=this.tickPositions,b=this.ticks,d=0;
|
||||
if(!this.maxLabelLength||a)p(f,function(a){(a=b[a])&&a.labelLength>d&&(d=a.labelLength)}),this.maxLabelLength=d;return this.maxLabelLength};n.prototype.addTitle=function(){var a=this.chart.renderer,f=this.axisParent,b=this.horiz,d=this.opposite,g=this.options,e=g.title,h;this.showAxis=h=this.hasData()||u(g.showEmpty,!0);g.title="";this.axisTitle||((g=e.textAlign)||(g=(b?{low:"left",middle:"center",high:"right"}:{low:d?"right":"left",middle:"center",high:d?"left":"right"})[e.align]),this.axisTitle=
|
||||
a.text(e.text,0,0,e.useHTML).attr({zIndex:7,rotation:e.rotation||0,align:g}).addClass("highcharts-axis-title").add(f),this.axisTitle.isNew=!0);this.axisTitle[h?"show":"hide"](!0)};c.dateFormats={W:function(a){a=new Date(a);var f=0===a.getUTCDay()?7:a.getUTCDay(),b=a.getTime(),d=new Date(a.getUTCFullYear(),0,1,-6);a.setDate(a.getUTCDate()+4-f);return 1+Math.floor(Math.floor((b-d)/864E5)/7)},E:function(a){return m("%a",a,!0).charAt(0)}};l(r.prototype,"addLabel",function(a){var f=this.axis,b=void 0!==
|
||||
f.options.categories,d=f.tickPositions,d=this.pos!==d[d.length-1];(!f.options.grid||b||d)&&a.apply(this)});l(r.prototype,"getLabelPosition",function(a,f,b,d){var g=a.apply(this,Array.prototype.slice.call(arguments,1)),e=this.axis,h=e.options,k=h.tickInterval||1,c,t;h.grid&&(c=h.labels.style.fontSize,t=e.chart.renderer.fontMetrics(c,d),c=t.b,t=t.h,e.horiz&&void 0===h.categories?(h=e.axisGroup.getBBox().height,k=this.pos+k/2,g.x=e.translate(k)+e.left,k=h/2+t/2-Math.abs(t-c),g.y=0===e.side?b-k:b+k):
|
||||
(void 0===h.categories&&(k=this.pos+k/2,g.y=e.translate(k)+e.top+c/2),k=this.getLabelWidth()/2-e.maxLabelLength/2,g.x=3===e.side?g.x+k:g.x-k));return g});l(n.prototype,"tickSize",function(a){var f=a.apply(this,Array.prototype.slice.call(arguments,1)),b;this.options.grid&&!this.horiz&&(b=2*Math.abs(this.defaultLeftAxisOptions.labels.x),this.maxLabelLength||(this.maxLabelLength=this.getMaxLabelLength()),b=this.maxLabelLength+b,f[0]=b);return f});l(n.prototype,"getOffset",function(a){var f=this.chart.axisOffset,
|
||||
b=this.side,d,g,e=this.options,h=e.title,k=h&&h.text&&!1!==h.enabled;this.options.grid&&q(this.options.title)?(g=this.tickSize("tick")[0],f[b]&&g&&(d=f[b]+g),k&&this.addTitle(),a.apply(this,Array.prototype.slice.call(arguments,1)),f[b]=u(d,f[b]),e.title=h):a.apply(this,Array.prototype.slice.call(arguments,1))});l(n.prototype,"renderUnsquish",function(a){this.options.grid&&(this.labelRotation=0,this.options.labels.rotation=0);a.apply(this)});l(n.prototype,"setOptions",function(a,f){f.grid&&this.horiz&&
|
||||
(f.startOnTick=!0,f.minPadding=0,f.endOnTick=!0);a.apply(this,Array.prototype.slice.call(arguments,1))});l(n.prototype,"render",function(a){var f=this.options,b,d,g,e,h,k,c=this.chart.renderer;if(f.grid){if(b=2*Math.abs(this.defaultLeftAxisOptions.labels.x),b=this.maxLabelLength+b,d=f.lineWidth,this.rightWall&&this.rightWall.destroy(),a.apply(this),a=this.axisGroup.getBBox(),this.horiz&&(this.rightWall=c.path(["M",a.x+this.width+1,a.y,"L",a.x+this.width+1,a.y+a.height]).attr({stroke:f.tickColor||
|
||||
"#ccd6eb","stroke-width":f.tickWidth||1,zIndex:7,class:"grid-wall"}).add(this.axisGroup)),this.isOuterAxis()&&this.axisLine&&(this.horiz&&(b=a.height-1),d)){a=this.getLinePath(d);h=a.indexOf("M")+1;k=a.indexOf("L")+1;g=a.indexOf("M")+2;e=a.indexOf("L")+2;if(0===this.side||3===this.side)b=-b;this.horiz?(a[g]+=b,a[e]+=b):(a[h]+=b,a[k]+=b);this.axisLineExtra?this.axisLineExtra.animate({d:a}):this.axisLineExtra=c.path(a).attr({stroke:f.lineColor,"stroke-width":d,zIndex:7}).add(this.axisGroup);this.axisLine[this.showAxis?
|
||||
"show":"hide"](!0)}}else a.apply(this)});l(v.prototype,"render",function(a){var f=25/11,b,c;p(this.axes,function(a){var e=a.options;e.grid&&(c=e.labels.style.fontSize,b=a.chart.renderer.fontMetrics(c),"datetime"===e.type&&(e.units=[["millisecond",[1]],["second",[1]],["minute",[1]],["hour",[1]],["day",[1]],["week",[1]],["month",[1]],["year",null]]),a.horiz?e.tickLength=e.cellHeight||b.h*f:(e.tickWidth=1,e.lineWidth||(e.lineWidth=1)))});a.apply(this)})})(m);(function(c){var m=c.getOptions().plotOptions,
|
||||
p=c.seriesTypes.column,q=c.each,u=c.extendClass,l=c.isNumber,n=c.isObject,v=c.merge,r=c.pick,a=c.seriesTypes,f=c.stop,b=c.wrap,d=c.Axis,g=c.Point,e=c.Series;m.xrange=v(m.column,{tooltip:{pointFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e {series.name}: \x3cb\x3e{point.yCategory}\x3c/b\x3e\x3cbr/\x3e'}});a.xrange=u(p,{pointClass:u(g,{getLabelConfig:function(){var a=g.prototype.getLabelConfig.call(this);a.x2=this.x2;a.yCategory=this.yCategory=this.series.yAxis.categories&&this.series.yAxis.categories[this.y];
|
||||
return a}}),type:"xrange",forceDL:!0,parallelArrays:["x","x2","y"],requireSorting:!1,animate:a.line.prototype.animate,getColumnMetrics:function(){function a(){q(f.series,function(a){var b=a.xAxis;a.xAxis=a.yAxis;a.yAxis=b})}var b,f=this.chart;a();this.yAxis.closestPointRange=1;b=p.prototype.getColumnMetrics.call(this);a();return b},cropData:function(a,b,f,c){b=e.prototype.cropData.call(this,this.x2Data,b,f,c);b.xData=a.slice(b.start,b.end);return b},translate:function(){p.prototype.translate.apply(this,
|
||||
arguments);var a=this.xAxis,b=this.columnMetrics,f=this.options.minPointLength||0;q(this.points,function(c){var e=c.plotX,d=r(c.x2,c.x+(c.len||0)),d=a.toPixels(d,!0),g=d-e,h;f&&(h=f-g,0>h&&(h=0),e-=h/2,d+=h/2);e=Math.max(e,-10);d=Math.min(Math.max(d,-10),a.len+10);c.shapeArgs={x:e,y:c.plotY+b.offset,width:d-e,height:b.width};c.tooltipPos[0]+=g/2;c.tooltipPos[1]-=b.width/2;if(d=c.partialFill)n(d)&&(d=d.amount),l(d)||(d=0),e=c.shapeArgs,c.partShapeArgs={x:e.x,y:e.y+1,width:e.width*d,height:e.height-
|
||||
2}})},drawPoints:function(){var a=this,b=this.chart,c=b.renderer,e=b.pointCount<(a.options.animationLimit||250)?"animate":"attr";q(a.points,function(b){var d=b.graphic,g=b.shapeType,h=b.shapeArgs,k=b.partShapeArgs;if(l(b.plotY)&&null!==b.y)if(d){if(f(d),b.graphicOriginal[e](v(h)),k)b.graphicOverlay[e](v(k))}else b.graphic=d=c.g("point").attr({"class":b.getClassName()}).add(b.group||a.group),b.graphicOriginal=c[g](h).addClass("highcharts-partfill-original").add(d),k&&(b.graphicOverlay=c[g](k).addClass("highcharts-partfill-overlay").add(d));
|
||||
else d&&(b.graphic=d.destroy())})}});b(d.prototype,"getSeriesExtremes",function(a){var b=this.series,c,d;a.call(this);this.isXAxis&&"xrange"===b.type&&(c=r(this.dataMax,Number.MIN_VALUE),q(this.series,function(a){q(a.x2Data||[],function(a){a>c&&(c=a,d=!0)})}),d&&(this.dataMax=c))})})(m)});
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user