Echarts 5 line graph click to change colour not working - echarts

I'm trying to make a line graph change color on mouse click by using the select.lineStyle.color attribute.
I'm able to trigger a colour change for the points upon mouse click using select.itemStyle.color and I'm expecting the select.lineStyle.color attribute to change the color of the graph but , it doesn't seem to work despite the documentation saying that select should work for all series.
I even programmatically fired the "select" event (not in the sandbox) but no changes were observed in my line graph.
My code sandbox
Extract from the docs
In addition, we've added click to select to all series, an interaction that was previously only available in a few series such as pie charts and maps, allowing developers to set it to single or multiple selection mode, and to listen to the selectchanged event to get all the selected shapes for further processing. As with emphasis and blur, the selection style can also be configured in select.
Please help me. I've been working on this for a week and found no solutions here. Is there something I'm missing?

Got my answer directly via posting an issue on their Github page.
Apparently, select is only applicable for data object, not series objects(or whatever you call it). So this feature is not available.
What I did, like most people, is to listen to the mouseclick event and update the series-line.lineStyle.opacity property in options directly to blur out other lines. Set triggerLineEvent:true so that clicking any part of the line will fire the mouseclick event, instead of just the data points.

Related

How to re-order Listeners for OnClick in the Inspector?

I'm currently having an issue with unity UI.
I have some buttons to who I've added an instruction in OnClick directly in the editor, but because it is in the last position in the list of instructions, it is executed at a poor time.
I would like to know if there is a way to move these instructions up and down, as to change the order in which they are executed ?
I've tried to slide them up and down to no avail, and no amount of google searches seem to help.
Feel free to ask any questions if you need more specific information !
Edit : Added a screenshot. I want to move the items in the circled area up and down if possible without having to delete it all and restart...
Screenshot of the hierarchy with concerned area circled:
Even if you were able to reorder events, order doesn't mean execution order.
https://forum.unity.com/threads/solved-unityevent-invoke-calling-order.265292/#post-1753393

mapbox with markers and checkboxes - disable all from showing on initial load?

I have a page I built to display wind direction/velocity in various locations along a bike trail:
http://microflush.org/cgi-bin/pathInfo.cgi
I have several markers in a legend, with check boxes to enable/disable them from showing up on the map.
My goal is to have NONE of the checkable markers show up on the initial load. However, when the page is loaded for the first time, ALL show up-- even though they're not checked. If I select 1, they all go away except for the one I selected, which will then disappear if I un-check that box.
Is there a way to make them all be invisible at first, and only show up if they're selected?
(You can view the source of the link above to see the code. I wasn't sure if I should post that all, since it's kinda long with all the points I've added.)
Thanks!
Resolved. The 'var map' needed to be defined earlier in the code. Working properly now.

Opening a popup on layer option click in leafletjs

I will be trying to show a set of options using the layerGroup functionality to filter out the markers. I need to show a popup when an option is selected from a layer which will prompt the user to enter a number based on which i will be showing the markers. Is there a possible way?
In the above sketch, there' s a sample filter at the top right which i intend to show using the layers but the thing is on selecting the 'Location' option i have to show a popup that will prompt the user to enter a location number and on that basis the markers should be placed on the map.
I guess there would be multiple ways of achieving this, depending on what behaviour exactly you want to get.
E.g. you could use a "dummy" layer (with name "Location" probably?), that you can add in the Layers Control (I guess that is the "sample filter at the top"?). Then listen for this dummy layer for being added to the map, and launch your modal ("popup") at this time. Then when the user enters the necessary information, you can programmatically add the corresponding markers to the map.
If you need further help, please add more details on what behaviour you try to get, or start your implementation and post new questions, so that you already have a start of what you are trying to achieve and people can elaborate on it.

How do I get a chart to redraw itself when the model is paused?

I have a Time Stack Chart whose data set can be changed by clicking on a radio button. While the model is running, the chart instantaneously updates its appearance when a radio button is clicked. When the model is paused, however, the chart's area becomes blank when a radio button is clicked; the legend, in contrast, updates automatically. How do I manually force the chart area to redraw itself?
When you pause a model, only a part of Anylogic is actually paused. The thread that handles the GUI keeps running, which is why you can navigate around in the model while it is paused.
This also means that if you try to update a chart's data while the simulation is paused, the appearance will refresh but -- as your data is being updated in another thread that is currently paused -- it will not have received that data.
If you want to pause the simulation and still be able to switch the data being displayed in a chart, you could take a look at the Airport example model. It provides a good method to switch between different charts by making them visible/invisible and adjusting the width, height, x and y. Essentially, you make all of the charts you need, overlap them perfectly, and then make visible the one that is currently of interest to you.
If you want to create the charts programmatically, on top of creating the chart with, e.g., new TimeStackChart(...), you also have to add it to the top level presentation group with main.presenation.add(...). If you don't do this, the chart will never appear in the model as the model won't have anything to display! To find more information on how to create a chart programmatically, make a chart in Main and then open Main in the Java editor. Find the chart you created, take a look at it's constructor (there are a lot of arguments!), and use it as rough template for the charts you wish to create. The Help documentation will further make sense of the parameters you see.
have you tried the chart.refresh(); method?
Also try to update the embedding agent using agent.onChange().
hope that helps
I encountered the exact same problem, and came up with workaround.
Try this, which I know works in AnyLogic v7:
if (getEngine.getState() == getEngine().PAUSED ){
dynChart.setSelectedItemIndices( new int[]{0} );
dynChart.setSelectedItemIndices( null );
}
I was able to get the chart to refresh manually when paused or finished by selecting/deselecting one of the legend items. I spent a few hours try out API variations to no avail, so I just emulated what was actually working in the UI and it worked.
I am dynamically generating a text item as the chart title, but I have not had the same luck getting the text to refresh when paused like the chart. Any ideas on that one?

Access Forms prevent mouse from selecting values from dropdown, force keyb input

I have a data entry form. Its properly tab indexed etc. and there are three dropdown menus which automatically unfurl with the on enter event.
No matter how much advice i give to users about using the tab key and keboard and checking what they just input.
they still insist on using the mouse to select values from the dropdown menus
the problem is that in their haste they often make mistakes as a result of using the mouse.
I would like to be able to force users to input into these fields using the keyboard.
the drop down is neccessary for users see the appropriate values for the field because the values will vary based on previous selections.
I have already tried experimenting with onclick events but to no avail.
Is there a way I can do this?
i am using access 2007 many of the users have access 2003.
Based on your comments, I would take one of two different approaches.
If your users are really comfortable with the codes AND know which ones they should use based on their previous selections, then just use text boxes instead of combo boxes. You can still put some validation code in either the Form_BeforeUpdate event or the individual control's _BeforeUpdate event.
If the users are not that comfortable, then I would suggest you have the first field in the combo boxes be the description of the code, not the code itself. So instead of choosing from 101, 102, 103 they are instead choosing from "Small", "Medium", "Large" or whatever those codes actually apply to. If you still wanted to display the codes themselves, you could do that with a separate disabled text box.
Now to answer your actual question. For the record, I highly recommend against using this approach. The simplest way I can thing of to prevent your users from using the mouse to select the combo box, would be to add a Transparent button covering the combo box.
To do this, draw a regular command button over the combo. Set Transparent = Yes, Visible = Yes, Enabled = Yes, Tab Stop = No.
When users click on the combo now, they will actually be clicking on the Transparent button and nothing will happen. The ONLY way they will be able to get into the control is by tabbing from a neighboring control or using a hotkey (via '&' in attached label).
Once they enter the control via Tab and your code forces a dropdown, they will still be able to choose an option using the mouse. But by forcing them to use the keyboard initially, it will make it much more likely that they just stick with the keyboard.
Again--I can't stress this enough--I think this is a terrible, horrible, no-good idea. Please don't use this approach. But you asked a technical question and this site is all about giving technical answers, so there you go...