diff options
author | fahimkhan | 2016-09-02 12:28:33 +0530 |
---|---|---|
committer | fahimkhan | 2016-09-02 12:28:33 +0530 |
commit | af0a1e7f2d785a6f0ef01cb6fd97725bbc27de1f (patch) | |
tree | 29c3f93fd3d10461184bb71253aabee0efc02940 | |
parent | 0421ea341fc01e2c9427f1796669ecb4be09bc9f (diff) | |
download | Online-NgSpice-Simulator-af0a1e7f2d785a6f0ef01cb6fd97725bbc27de1f.tar.gz Online-NgSpice-Simulator-af0a1e7f2d785a6f0ef01cb6fd97725bbc27de1f.tar.bz2 Online-NgSpice-Simulator-af0a1e7f2d785a6f0ef01cb6fd97725bbc27de1f.zip |
Remove Stacked plot option and make it work for multiple plot in different line
-rw-r--r-- | views/index.html | 76 |
1 files changed, 42 insertions, 34 deletions
diff --git a/views/index.html b/views/index.html index 748b587..3471303 100644 --- a/views/index.html +++ b/views/index.html @@ -99,10 +99,10 @@ v(in) v(out) <div class="container" id="plot" style="display:none;">
<div class="row">
<div id="graph" style="width:600px;height:400px;" class="col-lg-6">
+
</div>
- <div id="plotfunction" class="col-lg-6">
- </div>
+
</div>
</div>
@@ -176,7 +176,7 @@ v(in) v(out) alert("Please give the proper name");
}
- console.log(textFileAsBlob);
+ // console.log(textFileAsBlob);
// create a link for our script to 'click'
var downloadLink = document.createElement("a");
@@ -223,12 +223,9 @@ v(in) v(out) console.log("PlotList---->"+plotList);
var keys = Object.keys(outData);
-
- nonStackPlot(keys,outData);
-
-
+ nonStackPlot(keys,outData,plotList);
+
});
-
function destroyClickedElement(event)
{
@@ -236,7 +233,17 @@ v(in) v(out) document.body.removeChild(event.target);
}
- function nonStackPlot(keys,outData)
+ function nonStackPlot(keys,outData,PlotList)
+ {
+ traces = getTraces(keys,outData);
+
+ var layout = getLayout(keys,plotList);
+
+ Plotly.newPlot(document.getElementById('graph'), traces, layout);
+
+ }
+
+ function getTraces(keys,outData)
{
var traceObj = {};
var traces = [];
@@ -261,36 +268,37 @@ v(in) v(out) var value = traceObj[traceKey[i]];
traces.push(value);
}
-
+ return traces;
+ }
+
+ function getLayout(keys,PlotList)
+ {
var layout = {
- title:'Simulation Output',
- yaxis: {
- title: "Voltage(Volts) / Current(Amp)", // set the y axis title
- titlefont: {
- family: 'Courier New, monospace',
- size: 15,
- color: '#7f7f7f'
- }
-
- },
- xaxis: {
- title:"time(Sec) / Frequency(Hz)",
- showgrid: true, // remove the x-axis grid lines
- titlefont: {
- family: 'Courier New, monospace',
- size: 15,
- color: '#7f7f7f'
- }
- }
+
+ 'title':'Simulation Output',
+ yaxis: {
+ title: "Voltage(Volts) / Current(Amp)",
+ titlefont: {
+ family: 'Courier New, monospace',
+ size: 15,
+ color: '#7f7f7f'
+ }
+ },
+ xaxis: {
+ title:"time(Sec) / Frequency(Hz)",
+ showgrid: true, // remove the x-axis grid lines
+ titlefont: {
+ family: 'Courier New, monospace',
+ size: 15,
+ color: '#7f7f7f'
+ }
+ }
};
- Plotly.newPlot(document.getElementById('graph'), traces, layout);
+ return layout;
}
-
-
-
-
+
</script>
</body>
</html>
|