how to remove constant line from point line series? - lightningchart

I'm using constant lines to show a particular event for the graph and now I want to remove that particular event. I'm using constantline.dispose method but It's not working properly. lines are not getting removed after calling dispose function.

ConstantLine.dispose() should do the trick, and seems to work in the official interactive examples gallery (LCJS v.3.4.0).
If it is not working for you, please add some example code or pictures & description of desired and actual behaviours.

Related

Holoviews - how to set legend click_policy for decimated points

I'm trying to set click_policy to 'hide' in legend_opts for the object resulted from applying holoviews.operation.decimate on a set of hv.Points, but it doesn't seem to have the desired effect.
Now I'm using the muted_alpha option on the underlying hv.Points to hide the points, but this is suboptimal, since hovering over the invisible points still shows the tooltip, which is cluttering the output when showing multiple curves.
I've tried passing legend_opts={'click_policy': 'hide'} as opts for the Overlay container, as well as for both the underlying hv.Points and for the result of decimate (actually, I also tried passing it as an argument to decimate), but to no avail.
I even tried using a hook for the bokeh plot as suggested here to directly set plot_obj.state.legend.click_policy = 'hide', but that doesn't work either.
So, any idea on how to hide a set of decimated hv.Points completely (i.e., not showing the hover tooltips either)?
Note: I've followed the "Principles of datashading" section of holoviews' user guide on "Working with large data" and used decimate as indicated there.
Turns out that one has to set the options for hv.Overlay after calling collate on it.

Removing grid lines in a map and smoothing in maps

I am trying to remove the grids on my map. I used several commands for example: plt.grid(), plt.rcParams["axes.grid"] = False but nothing happens, the map produced as is with the grids. Is there any possible way to remove the grids?
Another thing also, how can I make my plot to be smoothed instead of having the data as blocks (see below a sample of the plot).
enter image description here
Please assist in this regard.
Truly appreciate your time.
Thank you.

Label individual points in Sage plot

This seems like a straightforward problem, yet I can't find a solution. In Sage, I've got about 30 sorted points for a scatter_plot, and I want to add the order position as a label. I know this is easy if I were working with a graph object, since I could use the vertex_labels option in plot. Is there a simple fix to get this to work for a scatter_plot, or would I need to do something like make the points vertices and keep track of the exact location of each point
Currently, you may have to use matplotlib directly or mess around with that method inside of Sage to get this. See here or here for some related questions.
I've opened Trac 20583 for this.

Replacing one d3 visualisation with another d3 visualisation in same place?

I'm using the datamaps library for d3 and I have asked the question unsuccessfully there on github so I wanted to cross-post it here.
What I'm trying to do is to visualise two measures – Income Inequality (Gini) and GDP per capita – in one world map and make it possible to switch between the two views.
I am almost there. Here is my example.
On the top you can choose which measure to look at and the updating works – except that the updated map is plotted underneath the previous one and not on top. This is happening even though I'm referring to the same id with both maps.
What am I missing?
Thanks for helping me!
EDIT: I managed to get it a little bit nicer – here is the updated version – but the maps are still printed over and over again below the space where they should appear.
I made a lot of these same mistakes when I first used D3. You have to use an enter(), update(), exit() pattern. There are lots of good tutorials on how to do that. Fundamentally, your structure is not setup correctly and is going to give you trouble.
For your code, you want to do the following:
Move the initial call to map() inside the map function.
Nest the map() function inside another function where you config your variables. You need to do all your global data/variable defining here.
Inside that config function, include d3.select(#radialbuttonname) and re run the map() function to update the chart on.click.
Inside the map function, you need to create functions for .data().enter(), .data.exit().remove(), and .data().transition(). That will replace the same SVG map area with a new map rather than just appending more svg's below.
You can change the tooltips and those other elements with if/then operators and remove() inside the map() function.
That should get you on your way..

How to draw a line or select something in using qvtkwidget?

I successfully made a program by using qvtkwidget, showing a few lines and points. And everything works perfectly. Next, I want to add an edit mode to my program, so that I can draw a line on it, or select some points or lines from it. Could anyone give me some guidelines for doing that? Do I need to use vtkRenderWindowInteractor? I tried to google but still can't find any clue.
you have to work with vtkinteraction, vtkobserver- callback, and vtkselection modules. and this example also useful http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertex HTH
And here is set of examples you may find relavent to your goal
http://www.vtk.org/Wiki/VTK/Examples/Cxx#User_Interaction

Resources