protovis
A visualization toolkit for JavaScript using SVG.
Protovis
I have a div tag with id "chart" but how do I get Protovis to render the chart inside that tag?
I tried the canvas method but it did not work.
var vis = new pv.Panel().canvas("chart").width(width).height(height)
I need to keep my JS code the greates the chart as part of the framework I'm working on and can't have scripttags inside the HTML body.
Source: (StackOverflow)
I'm having trouble figuring out how to animate a protovis streamgraph. I think the best way is to simply pass an array of i, j
indexes to .layers()
and have the .x()
and .y()
functions look up the actual updating values. Is there a simpler way?
Source: (StackOverflow)
Here is my Code on JsFiddle I am using d3.svg.area()
to draw an area and drawing the points as svg:circle
on it. whch works okay If I change .interpolate('basis')
to .interpolate('cardinal')
or linear
But how to put the points properly with basis
interpolation ? e.g. I want to put the near match
points
Source: (StackOverflow)
I'm using the protovis library (http://mbostock.github.com/protovis/) to draw a graph.
I uploaded the code I'm using in case someone wants to take a look at it:
http://jsfiddle.net/zobel/brEAD/
Here is my problem: Under Firefox, when I use the mouse wheel to zoom in or out, some mouse wheel events are not captured by my application but by Firefox itself. The result is that i end up getting a mix of zooms and page scrolls. You can test this by shrinking the Firefox window until the scroll bar gets visible.
This problem does not occur under Opera. Why does it happen and how can I solve it?
Thanks a lot in advance.
Source: (StackOverflow)
I have a div in which I create a chart using protovis. The div has width: 100%
and height: 100%
and the code to create the chart uses $('#chart').width()
and $('#chart').height()
to get the size of the div at render time and fill the page with the chart. I capture the resize event on the window and adjust the div and the chart so that it resizes when the window resizes.
Now I need to print. I would have hoped that when the browser is rendering the page for the printer it issues a resize but it doesn't, at least Safari and Firefox don't. Chrome does something strange in which it resizes only the height but not the width. Is there a way to trigger this behavior just before print?
EDIT. Consider the following html
<html>
<head>
<title>Resize</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#chart').resize(function() {
$(this).html('chart size is ' + $('#chart').width() + ' x ' + $('#chart').height());
})
});
$(window).resize(function() {
$('.resizable').resize();
});
</script>
<style type="text/css">
#chart { width: 100%; height: 100%; background: gray; border: 1px solid black;}
</style>
</head>
<body>
<div id="chart" class="resizable">
</div>
</body>
</html>
When I resize the window the content of the div changes. When I print it the render process does not fire the resize event.
Source: (StackOverflow)