Created
March 1, 2019 10:47
-
-
Save mvladic/c7e861ad7adc823fd0f6c7aa35acaff8 to your computer and use it in GitHub Desktop.
add_chart_sample.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var defaultValues = { | |
startFrequency: 1234 | |
}; | |
var values = await input({ | |
title: "Enter Start Frequency", | |
fields: [ | |
{ | |
name: "startFrequency", | |
unit: "frequency", | |
displayName: "Start frequency", | |
type: "number" | |
} | |
] | |
}, defaultValues); | |
connection.acquire(); | |
await connection.command(`FREQuency:STARt ${values.startFrequency}`); | |
var data = await connection.query("TRACe:DATA? 1"); | |
session.addChart({ | |
description: "This is description", | |
data, | |
samplingRate: 1000, // 1000 samples per second | |
offset: 0, | |
scale: 1, | |
format: 4, // CSV string | |
unit: "frequency", | |
color: "rgb(255,250,205)", // line color on black backround | |
colorInverse: "rgb(51,51,0)", // line color on white background | |
label: "This is y-axis label" | |
}); | |
connection.release(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment