How to create charts for integrals - c#

Im writing scientific/educational app. One of the features is calculating integrals aproximation with rectangle and trapeze methods. I want to display f(x) function chart with the results of the calculations where i could mark the areas that are accurate and inaccurate with different colors.
So far, i tried to use charts from DataVisualisation.Charting. For displaying f(x) functions i used Spline chart. In case of rectangle method i tried to use bar chart for aproximation.
There are two problems: firstly, the mesureing point are in the middle of the bars instead of on the right side; secondly, i don't know if it's possible to mark the inacuracies like on the pics above while useing the default library.

Related

Creating a chart for different Polygons C# WPF

I have a List<Geometry> containing data from Round Polygons and a List<Rectangle> where items will be added during runtime. I want to plot these data in a x-y-Chart at the bottom left position of my window. The output should look similar to this. The x- and y- axis should represent the angles in a round object.
I checked different approaches for charts and graphs like this and this, but I couldnĀ“t get a satisfying result.
Does anybody have an idea how this chart could be realised with WPF or knows where to look for examples which lead in a similar direction?

How to create Heatmap of eyetracking points in c#

I have a database that holds data of eyetracking on some videos.
I export those data to an int[,] input matrix for this issue. And then try to create a heatmap.
What I get so far is something like this:
and now I will try to use some gaussian smoothening functions to get a more heatmap like image. but when I used some applications to blur my heatmap, the result is:
but this is not actually what I want it to be. I want something like the heatmaps that you see when you google it, e.g.:
How can I create a "Heatmap" instead of my bitmap?
Instead of plotting points, have you tried plotting translucent circles (maybe 100 pixels in diameter) to see how that looks? Resultant opacity can be converted into blue/green/yellow/red.

DrawString Not Scaling Properly With Transform

I'm essentially re-writing a document viewer with markups to move away from a COTS product and so far everything has been working VERY well. My code is based off of Mark Miller's Extensions to DrawTools (http://www.codeproject.com/Articles/17893/Extensions-to-DrawTools).
The old viewer stores pages and their markups based on x/y coordinates in inches and I have had NO trouble converting this to a pixel-based coordinate system and converting lines, boxes etc to the new viewer. The lines and boxes show up exactly where they are supposed to and have the correct size.
The problem has been displaying text markups, no matter what I do they always end up MUCH smaller than they should be.
I'm doing:
UserControl->OnPaint()
Create a Matrix Transform for:
Scale
Rotate
Translate
Apply Matrix to Graphics Object
Call method that draws the Page Image and then all of the Markups.
I have the X/Y Coords and Font Size of the Text to draw, and the resulting string DOES end up at the correct coordinates but the text is WAY too small. The really bizarre part about this is the original viewer is written in .Net so I know that the Font and Size SHOULD relate especially since everything else scales so well.
Here is an example of what I'm talking about. Please ignore the BackColor and Border of the "This is some Text", I haven't gotten around to getting that transformed yet since I've been so focused on getting the TEXT right.
Original:
My Result:
I ended up having to rework everything to be Inch Unit based. The font simply doesn't have an easy way of scaling between the units and the Inch Unit turned out to be the easiest solution.

ZedGraph Bar Width

Is there a way to modify the width of a ZedGraph bar? If so, what is the code necessary to do so? Is it possible to make it so the bars scale with the zoom also? I have bars that don't show up because of the way the scaling works currently (there is a wide x-axis range, which makes all of the bars very skinny). If the bar is too narrow, it won't show up at all. I'd like the bars to be wider so they will always show up without having to zoom in to see them.
The documentation for ZedGraph has the following to say about bar type graphs (emphasis mine):
Typically, bar charts would be created with XAxis.Type = AxisType.Text or XAxis.Type = AxisType.Ordinal (both types use ordinal values), such that the bars are drawn at integral values along the "base" axis, starting with 1 (e.g., the first bar cluster is at 1.0, the second is at 2.0, etc.). However, the ordinal axis type is not a requirement for bar charts. It is possible to create a bar chart that is not evenly spaced, by providing X values and using AxisType.Linear (in this case, you may need to use the GraphPane.ClusterScaleWidth property to tell ZedGraph how wide the bars should be. See this wiki page for details). For bar charts, the tic marks are typically between the bar clusters, which can be accomplished with the Axis.MajorTic.IsBetweenLabels property. However, this property is only applicable for AxisType.Text axes.
Unfortunately the wiki link goes to the old domain which the authors of ZedGraph seem to have abandoned. However there is an archived version: Wiki Page
Finally you may find it helpful to check the excellent source code reference at sourceforge.

Display unsorted data in SL3 line chart

I'm having trouble with my Silverlight Chart. My model is unsorted, that is, the sorting is done on the server side. It needs to support year transitions, but as you can see from the screenshot the charting control automatically sorts the model and fills in the gaps. The line sort be ever increasing and not taking a dip on new year.
How can I make the chart display the data in the order specified in the grid control to the left?
Btw, using SL3
alt text http://img705.imageshack.us/img705/7602/unsortedsilverlightchar.png
The line chart is not designed to do the task you seem to be asking. After all the purpose of a line chart is to help the user trace a trend or even visually interpolate an interim value. However if the interval between horizontal points is not linear and always traveling in the same direction such lines meaningless.
I would therefore suggest that the Line chart is not appropriate or that you have some other hidden data which should be used for the Y-axis which would make the lines meaningful.
Alternatives might be to use a Scatter graph or a Column series where the y-axis value has been converted to a string and thus cause the series to use a Category based axis instead of range based one.

Categories

Resources