opentok-network-test-js
Version:
Precall network test for applications using the OpenTok platform.
79 lines (77 loc) • 1.44 kB
JavaScript
import Highcharts from 'highcharts';
export default function createChart(mediaType) {
return new Highcharts.Chart({
chart: {
type: 'spline',
renderTo: mediaType + 'Graph',
},
title: {
text: mediaType + ' bitrate stability',
style: {
fontSize: '14px'
}
},
subtitle: {
text: '',
style: {
fontSize: '12px'
}
},
xAxis: {
title: {
text: 'Time elapsed (sec)',
style: {
fontSize: '8px'
}
},
labels: {
style: {
fontSize: '8px'
}
}
},
yAxis: {
title: {
text: 'Bitrate (KBps)',
style: {
fontSize: '8px'
}
},
min: 0,
minorGridLineWidth: 0,
gridLineWidth: 0,
alternateGridColor: null,
plotBands: null,
labels: {
style: {
fontSize: '8px'
}
}
},
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: '{point.y:.2f} kBps'
},
plotOptions: {
spline: {
lineWidth: 2,
states: {
hover: {
lineWidth: 3
}
},
marker: {
enabled: false
},
pointInterval: 1, // one hour
color: '#0099CC'
}
},
series: [{
name: 'bitrate',
data: [0],
animation: false
}],
legend: false
});
}