Draw Graph inside word document using vb.net - vb.net

I'm trying to draw graph inside word document using VB.net.
I'm having the X-axis and Y-axis points and I need to draw a line graph according to these points.
Also next time when I run this tool and pass the document file, the tool is supposed to read the previous data points and draw another graph with the appended data of the previous points.
Thanks a lot

Related

How can I draw line chart with json data on Kotlin

I try to draw a line chart by using MPAndroid chart with JSON data. I use the MVVM arch. I have more than one fragment and I need to draw on all of them. Actually, I can draw line-chart inside fragments with the data I write manually it. But in my app the data will come from Internet as a JSON form. The line chart is not seen when the fragment is opened firstime. After firstime I mean when i switch pages then line chart is seen on the screen. I want to see line-chart, the fragment is open firstime not later. How can ı do?

Which sequence of PDF operators are needed to set the background color of Tf and TF contents?

I need to manipulate the content streams of a page in such a way that if the contents of Tf of one of the elements of TF matches specific values the background area of those squares/glyphs needs to change.
I think that I would need save the graphics state, after creating two different string objects, then apply a fill operator then restore the graphics state.
My question is: would the fill operator recognize the area of the matched string and fill just this?
Second: would I need to repeat this sequence for each element of the TF array?
It's not quite that simple.
You have to determine the position of the text yourself (by keeping track of the current transformation matrix for the whole page content stream and the text matrix for the text object in which your text in question is drawn) and then insert a path outlining that area and filling it just before the text object in question.
But this in particular means that it is not necessary to split the strings of the text drawing instructions to have the search text be drawn by itself.
By the way, if this change of background is meant to represent something like a text marker marking, an alternative to changing the page content would be to create text markup annotations for the determined coordinates. That way you would merely have to parse the page content stream for the coordinates, you don't have to change it. In particular if the text drawing instructions may also be in some form Xobject referenced from the page content instead of the page content itself, this may simplify the code.

Importing and mapping AutoCAD line segments to Anylogic Paths

I have an excel file containing AutoCAD line data that I wish to map to AnyLogic Path constructs. To do this I am trying to edit the XML file and adding in path objects with the requisite points. The AutoCAD data I have provides a center x,y, start x,y, end x,y, and angle for arc segments, and the standard points for lines. I can't seem to figure out how anylogic draws paths, though. I do not believe they are Bezier Curves, because every path contains 5 points as far as I can tell. For the straight line segments, it's easy enough to map, but for curves I cannot equate my Autocad ARC data with the Anylogic Path construct because I don't actually know how AnyLogic Paths are represented internally.
I tried a Bezier Curve which did not work. Tried adding in the center point of the arc segment as the fourth point but this did not work. Looked at B-Splines, doesn't seem to be this either.
Format examples from AnyLogic
To give more information about thow AnyLogic stores path information internally, here are some examples of the conversion the other way round, from the AnyLogic editor to the AnyLogic XML source file. There are (poly-) lines drawn in the AnyLogic editor and the coordinates of the corresponding end points in the AnyLogic point table and finally the respective XML AnyLogic source file representing the same line.
A simple straight line:
A more complex line:
Another line. The orange arrows show the connection between the visible points and the resulting XML:

How to measure different coordinates from a PDF file on Windows?

I am looking for a way to measure the coordinates of different rectangles on a PDF file?
Mainly I do have to perform some overprinting on an existing PDF and I need to know the x,y,w,h on where I am supposed to write the texts.
It seems that Preview.app on Mac has this ability but so far I wasn't able to find anything on Windows that does the same.
Please do not confuse this feature with the Measuring Tools from Adobe Reader which are used to measure distance in printed construction stuff, not the PDF page itself.
It seems that the default using of measure is point, so I need something that would allow to select a rectangle and that will tell me the coordinates.
Please do not suggest on exporting as a imagine and using something else to measure the pixels on the image.
Update: http://legacy.activepdf.com/support/knowledgebase/view.cfm?tk=rl&kb=11866 -- PDF Units, that's what I am looking for, something to measure the PDF coordinates in PDF units.
Disclaimer: I work for Atalasoft.
I know you said not to suggest this, but honestly, it's the easiest approach:
If you mean "sweep out a rectangle in the UI and report the coordinates", that's pretty straight forward, but it's going to be a build-your-own type of thing. What you will need are:
A PDF rasterizer (GhostScript, Acrobat, FoxIt, Atalasoft) to get you an image at a specific resolution.
A tool to display that image in a window and let you sweep out a rectangle (this is straight forward winforms type code for .NET, but we have a control that does this out of the box - combining 1 & 2 into one step).
A tool that can look at the structure of a PDF page and report back the crop box (if any) and the media box for each page (iText, DotPdf).
A tool/understanding of matrix transformations to build the matrix that goes from display space into PDF space (and/or vice versa, probably in iText, definitely in DotPdf)
The code flow becomes something like:
For each page:
Open document, pull out crop and media box, rasterize page, build transformation matrix.
Display image, build/hook into event for selection changing.
Push the image viewer rectangle coordinates through the transformation matrix.
Profit.
From a coding point of view (assuming 0 prior knowledge of this, but a decent understanding of linear algebra), from 3 days to a 2 weeks. If I were to write it, it would probably take on the order of a few hours, but I wrote most of our PDF tools and this is pretty easy.
If your goal is to intuit where rectangles are on the page and report back those coordinates, that's also doable, but it decidedly non-trivial in comparison. You need to write code that can rip through a PDF display list and interpret the contents correctly. That means being able to handle all the cumulative matrix transformations, the graphics state changes, the gstate object use, Form XObject placement, and so on. You need to answer the question "what is a rectangle?" because in PDF placement, it could be an re operator, a set of degenerate beziers, a set of lines, an image of a rectangle or (surprise!) a combination of all of the above. Honestly, intuiting anything about the content on a PDF page is a Herculean task.

Excel: Adding a Connector Line In a Chart (Have to Use a Macro)?

So I'm working on this chart in Excel, and the chart looks like two sides of a triange, like the picture at the link below:
http://a.imageshack.us/img832/6207/triangle.png.
I'd like to make a line (like, with an autoshape for example) that connects the 2 endpoints to form a triange; ie a line going from coordinates (4,1) to (4,5). I tried doing this by creating a seperate data series in excel with the coordinates of the connecting line, like:
4,1
4,2
4,3
4,4
4,5
However, in excel, all lines in this chart must have the same x coordinates. Does anyone know how to get a connecting line automatically? Say, with a macro or something? Reason I ask is because I want to be able to change these coordinates, and I want the connecting line to adjust with very little effort (ideally I could write a macro and assign it to a button that when you click it would adjust the connecting line). I have some very limited macro experience, but this is just beyond me. The type of chart I'm using is a standard line chart, where the description given by excel is "Displays trends over time or categories". Anyone know of a good resource or have some advice? Thanks.
PS I solved this problem by changing the chart type to a scatter chart, but this messed up the axes and scale, and required that those be adjusted, so I think adding a line in this manner automatically will be easier.
The scatter chart worked OK.
Used formulas included in the following image.
Perhaps you should include an image showing the problems you found.