i'm struggeling a little with my Autocad Plugin..
Since i have a huge amount of AutoCad Drawings to plot programmatically as a pdf-File i found out that some of them contain much unnecessary stuff on it.
i only want to plot a specific area which is defined in a layer. I have no problem of search for the layer and check for its properties but i can not find a single thing about coordinates or something like a height or a width..
So my question is simple: Is there a chance to get the height and width or something like that to print only the needed stuff inside the area of that layer?
Thanks
Alex
If you have a selection set of all the entities you want to plot, loop through and get each entities extents.
Compare each entity against a return value and grab the largest min and max points of everything in your selection set. This will give your the window area bounds you want to plot.
Related
I'm using WPF and OxyPlot and I wanted to hide some points on a series... however this doesn't seem to be possible to my surprise! Am I missing something? I am iterating over a set of points on a series, and I'm concentrating on a specific region of the graph of the series where I want the data points outside that range to not display.
I have a project where I need to calculate how many "widgets" i can remove from an area defined by the user.
for example, if i have a piece of paper... 13in x 23in. How many business cards I print when the business card dimensions are 5in x 3in.
I need something like this...
http://www.copel.com.py/calculadora-de-corte.html
But the best I can do is use a WrapPanel, which does a good job, but if I need to rotate an object, it leaves me with blank space. meaning that wrap panel works by rows, and each row takes the space of the largest object. leaving wastage around the smaller ones.
How do you suggest I attack this problem?
C#, WPF, XAML.!
Original Question
I'm using Microsoft Chart Control to display some data points as a Line. I have a Legend with custom items used to display calculated information about the line (mean average and others).
Now I've enabled IsUserSelectionEnabled which allows the user to "zoom into" a range of values and I want the legend items to be calculated on only the data points that are currently in view.
I can use the AxisViewChanged event to be notified of the view change, but what I can't figure out is how to enumerate only those DataPoint currently in view.
Update
The zoom isn't going to work for my purpose. What I discovered is that the NewPosition and NewSize properties of the AxisViewChanged event do in fact contain the precise area selected by the user, but the resulting zoom contains points outside of that area. I need more precision than that. What I need are two cursors, but the control only gives you one.
So my question now is: How do I customize this thing to add another cursor? I'm not asking just yet and if I do I'll start a new question.
Though I do still need to figure out how to translate client coords into data coords...
Updated again
I found the coord translation functions right on the Axis. Seems obvious in retrospect.
ChartArea.Axis.PixelPositionToValue (for whichever axis you need)
ChartArea.Axis.ValueToPixelPosition
I'm using the Visiblox WPF API and am having trouble getting the chart points in my line chart to scroll horizontally. Instead of scrolling, the points are get squashed together, in which, this isn't particularly a problem, except that I expect to have 100s of data points on the chart. I have looked throughout the examples available on the Visiblox website, but couldn't find what I was looking for. Ive attached an example screenshot.
Any ideas?
Thanks for your help,
Sparky
By default Visiblox Charts will re-calculate the range to include all the data in the series, so there are two possible approaches: 1) when you add the last point, remove the first one which will effectively move the visible window one point over or 2) set an explicit axis range and update that when you want to move the visible window.
Check out the Visiblox blog for more details on how ranges work at: http://www.visiblox.com/blog/2011/03/visiblox-charts-ranges-demystified
I just had something like this recently. Everytime I'd add a point to the cart I'd run a little section of code that would check the amount of time (my x-axis dimension) that had passed since 0. I also set up a range of data I always wanted to see. I always wanted to show 120 seconds of data on the graph. So I had something like this:
private void adjustXasis(int timeCount)
{
if(timeCount>desiredRange)
{
chart.axis.Xaxis.minimum=timeCount-desiredRange;
chart.axis.Xaxis.maximum=timeCount;
}
else //two minutes not reached yet
{
chart.axis.Xaxis.minimum=0;
chart.axis.Xaxis.maximum=desiredRange;
}
}
I don't have VS in front of me and I know that syntax for the axis min/max is wrong but you get the idea.
By default Visiblox Charts will re-calculate the range to include all the data in the series, so there are two possible approaches:
1) when you add the last point, remove the first one which will effectively move the visible window one point over or
2) set an explicit axis range and update that when you want to move the visible window.
Check out the Visiblox blog for more details on how ranges work at: http://www.visiblox.com/blog/2011/03/visiblox-charts-ranges-demystified
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.