d3.tsv("//localhost/wordpress/" + my_var + ".tsv", function(d) {
d.frequency = +d.frequency;
return d;
}, function(error, data) {
if (error) throw error;
x.domain(data.map(function(d) { return d.letter; }));
y.domain([0, d3.max(data, function(d) { return d.frequency; })]);
I am trying to integrate the my_var variable successfully in the file path but it is not working. Can someone explain me why?
var my_var = <?php echo json_encode($title); ?>;