Closed andig closed 10 years ago
simple but hacky fix for buildGraph
function:
renderer: self.graphs[0].renderer.__proto__.name
I found the same issue when I start with the 'line' renderer -- the preview is nevertheless 'area'. My workaround is to put
graph.configure({renderer:'line'});
graph.render;
towards the end of my drawChart function. It works, but is a hack. This issue needs a real fix.
My suggestion, I don't know if if will work with different renderers in the same graph Same buildGraph function on RangeSlider.Preview.js line 94:
var graph = new Rickshaw.Graph(graphArgs);
var ggrenderer = parent.renderer;
ggrenderer.graph = graph;
graph.renderer = ggrenderer;
self.previews.push(graph);
@andig, thanks, your hacky fix worked for me!
I'm still having this issue; is there anything that I need to do to make the preview render in the same way as the graph, or should this automatically happen?
Me, too.
This problem has been fixed in the latest code.
https://github.com/shutterstock/rickshaw/blob/master/src/js/Rickshaw.Graph.RangeSlider.Preview.js
<script src="js/rickshaw.min.js"></script>
<script src="js/Rickshaw.Graph.RangeSlider.Preview.js"></script>
I had an issue while trying to do a multi-renderer with non-stacked areas. To make it work, I had to add also
unstack: parent.renderer.unstack
in line 99-100. I think that the more general issue is that it doesn't make a deep clone of all of the parent's configuration. There could be more options missing...
All said. For now,
preview.renderer
is always 'area' until graph is reconfigured.