Skip to content

Instantly share code, notes, and snippets.

@gpDA
Created May 3, 2019 01:33
Show Gist options
  • Save gpDA/8d69fcb5216c8e9aae608d72407c9ceb to your computer and use it in GitHub Desktop.
Save gpDA/8d69fcb5216c8e9aae608d72407c9ceb to your computer and use it in GitHub Desktop.
d3.json("/sentiment-endpoint", function(data) {
var height = $("body").height()*0.6 - $(".panel-header").height() - 20,
width = $("body").width()*0.6 - 10,
stock = d3.stock();
var chart = d3.select("#chart").append("svg")
.attr("width", width)
.attr("height", height)
.attr('class', 'chart')
.attr('id','stockchart')
.datum(data)
var panel1 = stock(chart);
// price
printPrice1(data.list[data.list.length-1]);
// menu
$(".style").click(function(e){
$("#style").css({
top: "36px",
left: $(".style").offset().left,
right: "auto",
display: "block",
});
$(document).one("click", function(){
$("#style").css({display: "none"});
});
e.stopPropagation();
});
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment