named ticks
This commit is contained in:
+6
-10
@@ -20,21 +20,17 @@ function updateData () {
|
|||||||
function graphSpectralData (obj, dom) {
|
function graphSpectralData (obj, dom) {
|
||||||
// graph spectral data in obj into dom
|
// graph spectral data in obj into dom
|
||||||
var graphPoints = [];
|
var graphPoints = [];
|
||||||
|
var graphXTicks = [];
|
||||||
|
|
||||||
Object.keys(obj).forEach((element, index) => {
|
Object.keys(obj).forEach((element, index) => {
|
||||||
graphPoints.push([index, obj[element]]);
|
graphPoints.push([index, obj[element]]);
|
||||||
|
graphXTicks.push([index, element]);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(graphPoints);
|
console.log(graphPoints);
|
||||||
const options = {
|
const options = {
|
||||||
color: 'white',
|
grid: {color: 'white'},
|
||||||
grid: {
|
xaxis: {ticks: graphXTicks}
|
||||||
color: 'white'
|
|
||||||
},
|
|
||||||
xaxis: {
|
|
||||||
color: 'green'
|
|
||||||
},
|
|
||||||
yaxis: {
|
|
||||||
color: 'blue'
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
$.plot('#graph', [graphPoints], options);
|
$.plot('#graph', [graphPoints], options);
|
||||||
// flot expects an array of arrays (lines) of 2-element arrays (points)
|
// flot expects an array of arrays (lines) of 2-element arrays (points)
|
||||||
|
|||||||
Reference in New Issue
Block a user