gars_v2
Version:
Geo Assistant Research System
183 lines (176 loc) • 5.43 kB
JavaScript
class Plot {
constructor($container) {
this.$view = $('<div>').appendTo($container);
}
empty() {
this.$view.empty();
}
line({ data, title, xlabel, ylabel }) {
var options = {
chart: {
zoomType: 'xy' },
title: { text: title },
xAxis: [{
lineColor: "#000000",
tickColor: "#000000",
tickLength: 3,
tickWidth: 1,
title: {
enabled: true,
text: xlabel,
style: {
"color": "#000000",
"fontSize": "15px"
}
},
labels: {
style: {
"color": "#000000",
"fontSize": "15px"
}
}
},{
lineColor: "#000000",
tickLength: 0,
tickWidth: 1,
tickColor: "#000000",
opposite: true
}],
yAxis: [{
lineWidth: 1,
lineColor: "#000000",
tickColor: "#000000",
tickLength: 3,
tickWidth: 1,
gridLineWidth: 0,
title: {
enabled: true,
text: ylabel,
style: {
"color": "#000000",
"fontSize": "15px"
}
},
labels: {
style: {
"color": "#000000",
"fontSize": "15px"
}
}
},{
lineWidth: 1,
gridLineWidth: 0,
tickLength: 0,
tickWidth: 1,
tickColor: "#000000",
lineColor: "#000000",
opposite: true,
title: {enabled: false}
}],
legend: {
enabled: false,
},
credits: { enabled: false },
tooltip: { valueDecimals: 2 },
series: [{
name: ' ',
data: data,
lineWidth: 3,
color: "#000000"
}]
};
Highcharts.setOptions({
lang:{
numericSymbols: null
}
});
Highcharts.chart(this.$view.get(0), options);
}
hist({ data, title, xlabel, ylabel }) {
var options = {
chart: {
type: 'column',
zoomType: 'xy' },
title: { text: title },
xAxis: [{
lineColor: "#000000",
tickColor: "#000000",
tickLength: 3,
tickWidth: 1,
title: {
enabled: true,
text: xlabel,
style: {
"color": "#000000",
"fontSize": "15px"
}
},
labels: {
style: {
"color": "#000000",
"fontSize": "15px"
}
}
},{
lineColor: "#000000",
tickLength: 0,
tickWidth: 1,
tickColor: "#000000",
opposite: true
}],
yAxis: [{
lineWidth: 1,
lineColor: "#000000",
tickColor: "#000000",
tickLength: 3,
tickWidth: 1,
gridLineWidth: 0,
title: {
enabled: true,
text: ylabel,
style: {
"color": "#000000",
"fontSize": "15px"
}
},
labels: {
style: {
"color": "#000000",
"fontSize": "15px"
}
}
},{
lineWidth: 1,
gridLineWidth: 0,
tickLength: 0,
tickWidth: 1,
tickColor: "#000000",
lineColor: "#000000",
opposite: true,
title: {enabled: false}
}],
legend: {
enabled: false,
},
credits: { enabled: false },
tooltip: { valueDecimals: 2 },
series: [{
name: ' ',
data: data,
pointPadding: 0,
groupPadding: 0,
borderWidth: 1,
borderColor: '#000000',
pointPlacement: 'between',
color: "#54FF9F"
}]
};
Highcharts.setOptions({
lang:{
numericSymbols: null
}
});
Highcharts.chart(this.$view.get(0), options);
}
}
export default Plot;