how to make currentPriceIndicator be visible as default in Highstocks? - highcharts

https://www.highcharts.com/demo/stock/stock-tools-gui in the left menu there is a button to enable: "Current Price Indicator". How to make it visible by default?
I've tried series.lastPrice but it does not work in the same way as "Current Price Indicator".
Thanks.

To achieve functionality like Current Price Indicator from stock tool GUI you need toextend core Highcharts code, that activate the current price indicator.
Demo: https://jsfiddle.net/BlackLabel/e4rz60nw/

Related

Dynamically update a Bar Chart by user selecting checkboxes in Google Sheets

I have a horizontal bar chart where one of the bars on the chart needs to be dynamic based on a user selection of checkboxes in a google sheet. I can get this to work with one checkbox "=IF(C5=TRUE,D5+100,100)" but not sure how to get to work when multiple check boxes are selected.
enter image description here
I have a "Base UPH" of 100 and just need to add the values in the "Multiplier" column if the checkbox(s) are TRUE. The idea is that the user could select one or all of the checkboxes and see how the "C-Dynamic" would be improved.
Any tips, much appreciated Thanks!
Able to get to work, but only for a single checkbox with this formula: =IF(C5=TRUE,D5+100,100)
You could do it with SUMIF, like this:
=100+SUMIF(C5:C8,TRUE,D5:D8)

Customise Stacked Bar Data Labels

I have a dataset in google sheets that shows how often I do certain sports. I have created a stacked bar chart by month to follow the trend. I would like to use emojis to use as the data labels so that I don't need to have a legend. However I do not know how to change the data labels from being a count and to be customisable text?
For example for swimming I'd like it to show the emoji: 🏊 rather than "2" for jan, "4" for feb etc.
Is this possible?
It's not possible for stacked charts. It is for regular Charts, as you can see in this solution:
You can use emojis as labels by adding notes to the chart. You will have to copy the emojis from external sites and do the following steps:
In the column to the right of each data point, add your text notes (in this case, emojis).
Double-click the chart you want to add notes to.
At the right, click Setup.
In the box next to "X-axis," click More and then Add labels.
Enter the data range with your notes. For example, C1:C3.
Click OK.
In my case, the chart looks like this:
Since your Chart is stacked, this is not possible for this case. I recommend you to request this feature to Google by clicking on Help > Send feedback.

How to ignore hidden series when clicking on a legend using highcharts?

I have a charts done in highcharts in which I show and hide series depending on a checkbox (if the user clicks on a checkbox and all series are shown, if he unchecks the checkbox, some series are hidden).
It is working great.
Now I have an issue with the legends in the chart: if the series are hidden and the users enables a legend, the segment of all series (hidden or not) are shown in the chart.
I would like to handle the click item so I only handle series that are being shown.
To do that, I created an eventhandler for the legendItemClick event.
Inside it, I am able to access the legend (using this) but I am only able to call functions in a legend level, affecting all series. Is there anyway I could get to a series level?
Thanks!
Edit: created a jsfiddle as an example: http://jsfiddle.net/JLkGm/1/
Steps to reproduce:
1- unmark the checkbox
2- click twice in john + joe
Note that the segment related to Jane + Janet will show up
I would like to prevent this segment from showing if the checkbox is not checked.
ps: sorry for the js code in the checkbox event handler, we are using coffeescript, the original code was this one
toggleCompareData: (toggle) ->
columnName = COLUMN_HIGHCHARTS_TOKEN + #secondaryPrefix
if toggle
for serie in #chart.series
serie.show() if serie.stackKey is columnName
else
for serie in #chart.series
serie.hide() if serie.stackKey is columnName
It looks like bug, reported to our developers here: https://github.com/highslide-software/highcharts.com/issues/3309

How can I control legend items through a custom button in Highcharts?

I'm looking for a way of controlling legend items through my custom button.
The button will be placed out of the canvas area.
How can I get a list of legend items, and toggle them through checkboxes?
By doing that, I can give users more spaces to see graphs.
Thanks,
Sung Am YANG
You can look at the legend item names using
chart.series[0].name
chart.series[1].name
To toggle axes on and off, use
chart.series[0].show()
chart.series[0].hide()
e.g. http://jsfiddle.net/BasRN/ shows hiding and showing the first series with buttons, including setting the button text to the series name.

arranging StandardTitleBar elements

Can anybody help me how to arrange StandardTitlebar elements,for example I want battery indicator to be leftmost and network indicator rightmost,and clock to be center of status bar.
It's not possible. According to StandardTitlebar API,
You cannot change the order of components in the standard title bar. The positions are fixed to the order listed above. The order in which you call the add functions has no bearing on the position or order of these components.
So you have to stick to the order specified in API.
Only option for you to position fields is to create your own custom manager and add it to MainScreen using setTitle(). But then again I am not sure how will you create Battery, Clock and network indicator. BB doesn't provide any API for these fields.

Resources