you can see my test example of Highchart here: Chart test
When you click the "Reload chart" button, it reloads the chart with random numbers. But as you can see, the chart disappears for a very short time and reappears again. My question is: can I reload the chart more smoothly, without it disappearing for a very short time?
For me, using Chrome on OS X, it doesn't hiccup at all--the old chart is immediately replaced with a new one which then takes some time to animate into full view. So if it's the animation time you object to, I suggest simply setting the animate property of the chart to false to avoid that.
If that's still not good enough (e.g. other browsers might be slower), you can first turn off animation then use the Highcharts API to adjust the data and redraw the chart without recreating it at all. This may be more invasive, however, so it's worth starting with the first approach.
Related
I have used Charts library to make my chart. It really has ton of options, but I have been struggling to implement background for grid. I want to have gradient background, but just for grid part. I have done this by putting my view behind the chart view. I have printed _viewPortHandler.contentRect, and from there i positioned my view. Now, while this works, it is not most ideal solution. I would like to somehow at runtime have option to get gridview size, but since _viewPortHandler is internal, I see no option to do this:
Is there any better way to do this?
Vaadin 7.6.2
It appears when you attempt to scroll within a ComboBox, the listing moves a page at a time instead of smoothly scrolling up or down one line at a time, I'd prefer it scroll smoothly one line at a time instead of paging. This possible?
It is not possible with this version of component. But ComboBox have filtering functionality which is useful when you have a lot items in a list.
Probably, solution is to create your own widget.
I have two Meteor.Collections in my app. One contains a bunch of "slider" objects, which define a title, max, min, base value, and step for each slider. Now, I have two problems. The first is making the sliders show up in the first place. I've tried to put the following code:
Sliders.find().forEach(function(slider) {
$("#"+slider._id).slider({
min:slider.min,
max:slider.max,
value:slider.base,
step:slider.step,
change:function(event,ui) {
Data.update({_id:Data.findOne({slider:event.target.id})._id}, {$set:{value:ui.value}});
}
});
});
in Meteor.startup, at the end of my client.js file, in a $(document).ready() block, and nothing seems to get it to work. When I paste it into the javascript console, however, it works. Anyways, that's my first problem.
My second problem is that whenever I slide the slider, the slider disappears. I can keep dragging the mouse around to change the value, but once I let go of the clicker, I can't change the value anymore. I've tried using the above way and calling a Meteor.method that changes it on the server side. It's the fact that I'm updating a collection that is published to the same client that makes the slider disappear. Anything short of that doesn't cause it to disappear. How should I deal with this?
Thanks!
Have you already tried using the Template.preserve method? http://docs.meteor.com/#template_preserve
I have a highchart displaying multiple series, each contains 100+ data points
I have a UI containing a checkbox for each series that when clicked calls the series.hide() or series.show() to toggle the hide/show of each line
My problem is that the hide and show are extremely slow such that I cant check one checkbox whilst processing from a previous is taking place
Does anyone know how to handle this?
Thanks
Rather than calling hide() for each series, call setVisible(false, false);. This second parameter is the redraw parameter, and you can avoid causing a redraw (which is slow) for each series.
Then, after you're done changing visibilities, call chart.redraw() once.
http://api.highcharts.com/highcharts#Series.setVisible
as answered in:
Hiding _groups_ of series in Highcharts and jQuery: how to get acceptable performance?
highcharts draw each time a show or hide is called;
disabling and enabling the redraw function worked for me;
var _redraw = this.chart.redraw;
this.chart.redraw = function(){};
//do work
this.chart.redraw = _redraw;
this.chart.redraw();
How about adding visible: false for the series that are hidden before calling Highcharts.chart()?
Please see references: 1. Highcharts API and 2. Demo
In my case, above approach showed the best performance comparing to the followings:
series.hide()
setVisible(false, false)
setVisible(false, true) or setVisible(false, false); redraw();
I originally asked this question on the Highcharts forum a few days ago but received no answer so let me ask it here:
I want to have a chart where I can toggle the 'reversed' property of the Y-axis after the chart has been initialized and then see the chart redrawn. My first thought was to put something like the following code inside of an event handler (say in response to a button click), but it doesn't seem to do anything.
chart.yAxis[0].reversed = !chart.yAxis[0].reversed;
chart.redraw();
I don't think it's possible (see this forum post).
In particular, the last response on that post concludes with this:
I would suggest a workflow for your gui that updates a structure that keeps the options and then creates a new chart based on the options. The api we have has more of a focus on changing the data that is displayed than changing how the data is displayed.
So you might have to create two charts (one for each axis direction), only display one of them at a time, and toggle between them at runtime.
Update:
The accepted answer on this duplicate question suggests it is possible by doing this:
chart.yAxis[0].update({
reversed: !reversed
});