Is it possible to get the value of the visibility of a series? I know how to change it. But is there anything like series.getVisibility()?
There's a read-only property on the series object named visible that you can use for that.
series.visible
Assuming that chart is your chart var.
chart.series[0].visible, gets the first serie visibility.
Related
I have a repeat control bound to a (multi column) viewScope array.
The idea is that the chekboxGroup value will come from the first column and that the tooltip will come from the second column from the array.
The first thing (checkbox value) is not the problem. (see code)
The second thing is:
How can I assign the correct tooltip to the correct checkbox ?
<xp:repeat id="repeat4" rows="100" value="#{viewScope.choices}"
indexVar="rownumber" var="row" first="0">
<xp:checkBoxGroup id="checkBoxGroup2" layout="lineDirection">
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:return viewScope.choices[rownumber].get(0)}]]></xp:this.value>
</xp:selectItems>
</xp:checkBoxGroup>
<xe:tooltip id="tooltip1" for="checkBoxGroup2">
<xe:this.label><![CDATA[#{javascript:return viewScope.choices[rownumber].get(1)}]]></xe:this.label>
</xe:tooltip>
</xp:repeat>
EDIT
It seems that the tooltips work but are displayed off screen.
How do I manage to display them at the correct spot ?
Add position="before" or position="above" or position="below" to your tooltip control.
<xe:tooltip id="tooltip1" for="checkBoxGroup2" position="before">
By default it is "after" and this is outside the visible area in your example.
I have a highstock graph with flags that initially is correctly set.
See on Figure 1:
The graph's data is loaded dynamically when the vertical scroll bar is changed. The only thing that changes is the series data with the function
function afterSetExtremes(e) {
var new_data_to_be_loaded = getNewDataToBeLoaded();
chart.series[0].setData(new_data_to_be_loaded);
}
The new series data is loaded correctly but the flags is incorreclty re-arranged, se the Figure 2:
So what's wrong on the setting, since the chart.series[0].setData just set the series not the previous flags added?
Almost a solution:
I found that setdata(data, false), setting the animation/redraw to false solve the problem of wrong flag positioning.
Take a look at that: http://jsfiddle.net/b6b63nwy/10/
But this did raise another problem: the series tooltip does not appear anymore. Is this a highstocks bug?
The answer:
http://forum.highcharts.com/highstock-usage/bug-series-tooltip-doesn-t-render-when-use-series-setdata-t37593/
=====================================================================
If you take a look at the Series.setData section in the official API, you will find that the second argument is a Boolean property which tells if redraw the chart. Instead of setData, try to use Series.update() function.
API Reference:
http://api.highcharts.com/highcharts/Series.setData
http://api.highcharts.com/highstock/Series.update
Is there a way to modify a Vaadin chart by moving a bar or a point from the chart itself? i.e. I have a bar chart with a certain value in one of the bars, I want to get a new value by dragging that bar to that new value.
There is something similar in this example, that is why I wonder if it is possible to extend this option to something like what I need.
Thanks!!!!
I assume that vaadin uses Highcharts if this is the case, maybe you can use plugins, if so I recommend:
http://www.highcharts.com/plugin-registry/single/3/Draggable%20Points
Source code in case you had to rewrite it:
https://rawgit.com/highslide-software/draggable-points/master/draggable-points.js
Regards.
Basically I want to do simple thing - save to user cookie chart xAxis.min and xAsis.max when user uses the Navigator, so that next time I could show him chart on the same selected period.
Is there some kind of onChange event or I have to read chart's parameters in setInterval?
You can use the xAxis.events.afterSetExtremes (API) or xAxis.events.setExtremes event. From your requirements I would assume that afterSetExtremes is sufficient.
If you want to only capture changes through the navigator you need to check
if(event.trigger == 'navigator'), otherwise you can just look at general changes.
Here is a JFiddle Highstock demo that shows the use of setExtremes event and what event.trigger values you can get.
I want to make a chart with 4 series' and show only 1 or 2 of them at the same time. The user can choose, which series he wants to see. This works fine with series.show and series.hide, but the baseSeries, set in "navigator", doesn't change.
Is there a way to change it dynamically?
Navigator series is based on first series data, as a result is not updated. In case when you would like to update navigator series, you need to use setData() on series[1] object.
http://jsfiddle.net/sbochan/HwuRr/
chart.series[1].setData([5,2,1,2,4,6,10]);