I've been using Winforms and the built in Charting library to accomplish this task in a hacky sort of way, but the team I'm developing for wants a more interactive solution. I wish I was able to just stack several charts, but as the graph is representative of a digital timing diagram, they need to share the same x-axis. I'm looking at LiveCharts as a solution, but I can't figure out if it's possible to vertically stack the multiple y-axis items to achieve my end goal. Ideally, it would look like this:
It's very important that I maintain them as one chart so that they share the x-axis, and comparisons can be made within the same chart timing wise.
The data getting used is from a generated log file, and is not collected in real time. I would manually offset the data, but the user can choose the order in which the graphed lines are displayed, so I would have to go through the entire series and offset it each time the user moved it.
Perhaps livecharts is not the way to go here? It needs to be a free implementation of something, or SciCharts v2.2 (but I can't find archived documentation) as those are the only resources I currently have access to.
While your question doesn't specifically relate to SciChart, you have tagged it, so I have a suggestion for you.
There is a vertically stacked axis feature in SciChart WPF. This allows you to substitute the YAxis Container template for anything you want. In this example we use a UniformGrid. The result is as follows:
Several traces are on the same plot, but at different vertical positions. Each axis is stacked one over each other. They share the same XAxis and hence response to zooming, panning, tooltips as if they were one chart.
The source code to the above is on the Example Webpage. All the scichart WPF Examples source code is hosted on GitHub so if you click through to the above then scroll down to source and click 'View on Github' you can see how we have achieved this type of chart.
Disclosure to community: Im the tech lead on the SciChart project
Related
I am working on a project that requires me to develop an application using the Universal Windows Platform (UWP). I have no prior knowledge of developing UWP apps and XAML is completely new to me. Thankfully however, I am competent at writing in C#.
The project I am working on involves recreating the Tafl Board games - Hnefatafl, Brandubh, Tablut, etc.
Now, while I'm fairly confident in my ability to create the underlying logic for the game, I find myself bamboozled when it comes to creating the interface using XAML.
Several different chessboards will need to be rendered: 7x7, 9x9 and 11x11.
So my question is two-fold.
How do I create a chessboard in XAML that will scale appropriately to different window/display sizes and be able to be backed by a grid behind the scenes (i.e. The application can detect which square of the board is touched, etc)
How do I go about rendering a different board depending on the game type selected?
Apologies if this is a terrible question but googling hasn't helped me a whole lot and StackOverflow has always been a great source of information.
You might want to try out the RelativePanel control and use different coloured rectangles for the tiles. This would resize for different screen sizes.
I hope you finally got an answer to this that led you in the right direction. If you didn't here are some ideas that might narrow your research terms and get your going. I'd give you working samples but youd did mention it is for a school project :).
Using a listbox and manupulating the base style can be a relatively
good way to go, and very reusable. This also fulfills your
requirement of knowing the tile currently selected as the listbox
already handles that. I used this technique for a Sudoku board that
had alternating colors for the different regions.
Create a UserControl with properties for the number of columns and
rows you need for your board and then dynamically add the rows and
columns to the grid. If your game model has a list of tiles and
each tile has a column and row property that can be mapped to the
column and row indices of the grid, you could potentially bind to it
quite easily.
Create a custom control that handles the columns,
rows and other aspects of the board itself in c# and the rendering
in XAML. I personally shy away from this just because the existing
controls are already so flexible that with enough ingenuity you can
create what you need with out of the box controls.
I need to draw a graph like the one shown above in my application. The values for Y axis is updated periodically which is obtained from an electronic device and X axis refers to time elapsed . By default, the viewing range of X axis is automatically updated (extends horizontally) as seconds elapse.
One thing I find pretty challenging right off the bat is, users can also manually set the range of X and Y axis, so I need to come up with a flexible way to handle that part.
Can I get some recommendations on handling the above requirements? I prefer WPF but Winforms is fine too. Are there any example projects which solves a problem similar to above?
Or any third-party dlls I can use (for commercial purposes)?
One way I'm considering switching to right now is simply embedding a web control in whatever type of application (winforms, wpf) and then using html/javascript to draw the graph using an opensource library such as : flotr2, Style Chart, jqPlot, Protovis and D3. The benefit of doing it this way is that if you decide to change platforms your graphing doesn't need to change.
Right now I'm using Dynamic Data Display, which is a WPF graphing library.
winforms:
.NET3.5 onwards has chart controls built in (I think)
Im new to this too but you have to create the chart control and then create a series object with the data. Then the update the chart control with the series that contains your data.
There is a sample project here:
http://archive.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=4418
I need to visually show a line from one image to one or more images to represent a server connected to one or more servers. I'm assuming WPF is the best tool for this and am using this project to learn and evaluate WPF and determine if we should start migrating from WinForms.
I'm trying to keep the layout simple for purposes of re-sizing and managing the layout. So the image representing the source server is in the upper left and all connected servers are listed down the right side. I'm new to WPF and Expression Blend and have been struggling with how to draw the connectors. Right now I have the images in a grid. After some frustrating attempts to draw lines using tiled images I started to use a line with a GradientBrush which looks like a 2D pipe. This seemed like a decent approach. But I'm hoping there is an adequate method to draw a path similar to my mock up.
Thoughts...
Put the lines in the grid and span multiple rows and columns
Put the line on a canvas which spans all rows and columns
I assume the line paths will need to be determined in the code behind, But I've been impressed with everything XAML is capable of.
I'm just a WPF noob and a little overwhelmed by everything that WPF can do. This seems like something that's been done many times before but I cannot find any related WPF examples and would prefer to minimize my frustrating attempts :-)
I would use Canvas instead of Grid because you can use absolute positioning with Canvas.
Take a look at this 4 part series on CodeProject to get some ideas.
You can try using Seperator in between the images. Put seperator in a stackpanel so you can control its orientation to horizontal or vertical and you can also change its color and thickness. If you place seperator in a canvas you can also control its placement.
I need to display several graphs which have a common X Axis and a legend. What I want to achieve is displayed on the picture. The main goal is to have several Y Axis on the one line, not paralelly. So, several curves can be displayed without intersection with each other.
I know how to display several graphs, but then each of them has its own legend and Y Axis.
I worked with ZedGraph in two of my projects and it doesn't seem to support this feature. Basically, you have two options at this point:
1. Use another plotting library
If you don't have a lot of things depending on ZedGraph already, maybe it's not too late for switching to another plotting control. I worked with this library (CodeProject link), and it has a decent look and support for stacked graphs:
It's less feature-rich compared to ZedGraph, but if 2d-plotting is all you really need, you should probably give it a try.
2. Cheat by creating multiple ZedGraph panes
You can make all your graphs panes have the same width and the same zoom. By setting IsSynchronizeXAxes property to true you make sure that all the panes on ZedGraph control have their X-Axes synchronized automatically.
There are few useful articles to help you achieve the effect you want. Although in Russian, they provide code samples and illustrations and should be of use even without understanding the comments.
Plotting multiple graphs on single ZedGraph control
Multiple graphs layout
Synchronizing zoom and pan on multiple graphs
Aligning graph panes properly
You should also hide X-axis and everything else that you don't need. Single legend is tricky but can be achieved by only showing a legend for the topmost graph and adding fake dummy curves with no points to this graph to populate the legend.
Question for you all, I've been charged with developing an application to view data about a testing cycle we do for environmental screening, products are placed in an environmental control, freezing and heating the product while a variety of self-tests are run. My manager would like to see a graph of temperature over time as an x/y graph, but he'd also like to have an indicator for where the test is currently at that has a small box, giving additional info, (test status, current test, running time etc.)
So what I'm thinking is I need to make a custom control that is capable of displaying this scatter graph and can also contain another content control for my additional info box, what base control should I use as a foundation, what should I look at for drawing my graph, and how can I do my layout for this? I'm assuming the use of a canvas control is my best bet for layout, and DrawingGroups with PathFigures for the graph... anyone capable of giving me more guidance?
VisiFire maybe it's your choice.
maybe you should check out Sacha Barber's WPF Graph Control. This may be a good starting point