I was wondering if there was a nice way to allow users to create nodal graphs (with restrictions) as with LabView.
Something like this:
I have seen http://www.pyqtgraph.org/, which seems to have something similar, and I do intend to use PyQt as my base (though I do not mind linking in C++ code), but it doesn't quite have the look and feel I wanted.
Any pointers to the right direction would be great.
There is a Diagram Scene Example which uses the Graphics View framework to make flowchart diagrams. It is an application in which you can add flowchart shapes and text and connect the shapes by arrows. The shapes, arrows, and text can be given different colors, and it is possible to change the font, style, and underline of the text.
You can take a look at the code and see how to create custom graphics items and handle mouse events and movement of items. Then change the look and behavior as you like.
Check another diagram editor here.
[not enough reps. to comment]I too had a similar task to implement. For me it was a large and complex block diagram. It was really hard to implement using QGraphicsScene. I posted a question on SO and instantly gained enough downvotes. No one gave any useful hints. So I did the hardway. Created images of lines with transparent background and changed the style-sheet dynamically. I don't know weather this is the right way. It will be really helpful if someone gave insights on this.
Related
What I want to do is pretty simple in my head, but might be very hard to do.
Currently, I did set up RichTextFx in my JavaFX project and created a code area. What I'd like to do is make some words a certain color depending on a custom dictionary that I'd make. For example, I'd have an array list for all the words that should be red, and I'd somehow link it to the code area.
I have absolutely no idea how to do that, and if it even is possible.
Anyway, I'd very much appreciate it if you could help me!
I have a simple to do tree application that displays a QTreeView inside of a QMainWindow. I want to give the user the ability to change the magnification level of the content (using a spinbox most likely), but without actually changing the underlying font size of the text.
Is there a way to do this without changing my whole app to a QGraphicsScene? The app is just showing a good-old fashioned tree with text, no graphics or anything fancy other than wanting to change the magnification of the view; hence, I am thinking that switching to a graphics scene would be overkill.
Or, am I wrong, and switching to a graphics scene is the only simple way to do it?
Note a trimmed down version of the app is at Code Review. It contains a SSCCE, but is a bit long to post here.
In a site discussing how to put widgets on a scene, trolltech wrote (emphasis added):
I myself and several other Trolls’ve spent some time researching this
topic [how to embed a widget in a QGraphicsScene]. It’s not trivial;
most solutions to embedding widgets into a scene end up with several
serious drawbacks. That’s also why Qt doesn’t have any off-the-shelf
solution to this.
Widgets cannot be scaled or rotated, but graphics items can.
This suggests I cannot perform, in a simple way, the operations I want to on my QWidget by itself. That is, perhaps I need to add it to a scene, which is what I was trying to avoid. If that is the answer, then I'll accept it and start a new question if I get stuck doing that.
Note I just found this question, which is pretty much a duplicate, and does not have an (accepted) answer.
Related content
http://www.qtcentre.org/threads/62745-Zoom-a-view
QTableView Zoom In/Out
Drawing widgets (such as buttons) over QGraphicsView
QGraphicsView Zooming in and out under mouse position using mouse wheel
https://forum.qt.io/topic/15308/qgraphicsview-zooming-with-qslider
https://wiki.qt.io/Smooth_Zoom_In_QGraphicsView
As suggested by the docs quoted from trolltech in the original question, there is no built-in method to zoom on a view.
If the goal is to avoid the use of QGraphicsViews, the simplest way to separate the size of the font on the screen, versus the size of the font saved or printed, is to basically have two fonts. One to be displayed on the screen you can call 'zoom', versus the other to be saved/printed and call that 'font size'.
I got this idea from qtcentre (in a post I added to the original post too):
http://www.qtcentre.org/threads/62745-Zoom-a-view
I have been using the System.Web.UI.DataVisualization.Charting pie chart control to display pie chart.
With the introduction of IE9, these graphs seem intermittantly to not load and just present the user with an image not found.
I have decided to replace this with DevExpress's WebChartControl and implement their Pie Chart.
I got their pie to resemble ours 90%, but am stuck at getting the pie's fill to match.
This is best explained with images.
Here is my original MS Chart Pie:
Here is my new Dev Express Pie:
The old pie seems to have a shadow effect around the border that makes it look much better.
Is this kind of effect possible with the DevExpress control?
I have tried playing with:
((PieSeriesView) series.View).Border
((PieSeriesView) series.View).FillStyle
Both don't seem to do what i want.
Any help will be greatly appreciated
I tried for about an hour to get the desired result for you, but unfortunately I just can't seem to be able to get deep enough to be able to introduce a new painter with the Drawing2d.PathGradientBrush.Blend option (which would be able to give you the desired look).
I have placed a question on your behalf on the support center Q337316, you are welcomed to track this question which I would imagine will turn into a suggestion.
So although this isn't a good answer, I don't think you will be able to achieve the results in the current DX library.
We have answered this question in the RadialGradientPainter - Support PathGradientBrush.Blend thread. I've also talked to guys from the XtraCharts team. This is impossible to implement in WindowsForms Charts, but should be possible in WPF. If you are interested in this alternative, drop me a line and I will add the required information here.
Ok I had asked a question recently based on this.
But I need to narrow down more..
I need to create a network graph with nodes in flex. Once I give the input the nodes must get connected with each other if they have something in common.
The nodes must be click-able to show which other nodes it is connected to.
A simple code example will be appreciated.
Can a bubble chart be modified to do this?
Thanks
I think you can try Flare.
Take a look at the demo for Layout.
i personally think, a bubble chart is not really the right way to go ...
most simple thing - in a flex world - would be to subclass UIComponent twice, for, let's say, NodeView and ConnectionView, and then put all this into some container, with absolute positioning ...
other way would be to simply add a Sprite to a UIComponent, and do the same thing in plain AS3, simply subclassing Sprite twice ... less overhead and other problems, but will not benefit from flex features, such as styling ...
do you already have a model for the network? do nodes also have coordinates, or do you need to arrange them your self?
or, if loaded externally, can you show some sample data?
greetz
back2dos
I'm building a Flex app that includes an area chart, and when users hover over an AreaSeries, I'd like them to see the DataTip for the nearest data point in the series. The problem is that as far as I can tell (and I should admit at this point to being fairly new to Flex), mouseSensitivity is the only way to control when data tips appear.
If I set that to, say, 1000 pixels and tell Flex to only show a single data tip, that sometimes works, but frequently, the nearest data point is not one in the series on which the user is hovering (and in any case, it starts acting odd with such a high mouseSensitivity).
So my question, in short, is how to exert fairly direct control over which data tip is being shown at any given time. Thank you in advance.
Unfortunately i don't think there would be a straight forward method of achieving this just using a charts default members. I would expect you'd need to extend the chart component you were using and tie in with the internal workings of the chart. This isn't such an easy thing to do and the inner workings of the chart components are pretty complex. Something that isn't helped by a fairly messy implementation inside some of the classes.
There are obviously several directions you could take in solving this particular problem some that are more elegant than others.
It's defiantly possible but it's probably not a job for someone that is relatively new to flex. If i were you i would probably try to find a compromise to your requirements until you feel more comfortable delving into the chart components code.
IF you do decide to give it a go then you should come back with specific problems as myself and others are probably reluctant to solve such a big problem.
Keep the hitTest() method in mind: this is often the mouse-related unity of last resort.
Cheers