Using itext and jfreechart need to create image for legendtitle alone - itext

Can you please help me to get Image for legendtitle alone ?
I am using pieplot3d & doing customization and later I create legendtitle(plot
when I use draw method
legend.draw(graphics2d,rectangle2d
graphics2.dispose
Image.getInstance(template
I am using jfreechart with Itext & doing as mention below
add image to document or PdfCell its empty.
My requirment is to show plot/chart in seperate cell/table & legend in seperate cell table so that when there is change in size of legenditems size of chart wont change.
Please help.

Related

Display Syncfusion Chart TrackBall at top of Chart

We want to display our TrackBall label at the top of the Graph. We do not want to GroupAllPoints but that appears to be the only way to get the label to appear at the top of the graph.
When we do set LabelDisplayMode="GroupAllPoints" the label ignores the LabelTemplate we have set on the LineSeries. I assume that is because GroupAllPoints covers multiple Series.
How do set LabelDisplayMode to NearestPoint but display that label
at the top of the graph?
Alternatively how do I create a Template that does get picked up
when GroupAllPoints is set. Despite us only having a single point
to display in the TackBall. We'd only be doing this if there was no other way to get the trackball to display at the top of the graph.
Based on your requirement we have prepared a sample for your reference. In which we have achieved your requirement using the "annotation" property in the chart. Please find the below sample, code snippet, and screenshot.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/AnnotationSample-1842581013.zip
Code Snippet:
<ejs-chart id="lineContainer" >
// add additional code here
<e-chart-annotations>
<e-chart-annotation Content="<div id=lineContainer_tooltip></div>" X="90%" Y="1%" CoordinateUnits='#Syncfusion.EJ2.Charts.Units.Pixel' region="Series"></e-chart-annotation>
</e-chart-annotations>
Screenshot:

Writing to absolute position while using direct content

I am creating a pdf-document. First I add a table and some Texts to the PdfWriter. Now I want to add a costum template (including images and texts): I have to get the direct Content, which ist a layer over the PdfWriter-layer:
over= PdfWriter.getDirectContent();
I want to set the template exactly after the content on PdfWriter-layer.
I can use
writer.getVerticalPosition(true)
for my calculation of y-Position on PdfWriter-layer.
This way I can add the costum template to the upper layer at that position. Now back to PdfWriter-layer how can I set the position of PdfWriter-layer after the tempalte on over-layer?!
Can somebody help?
Thanks in advance.
Mixing content added with document.add() and direct content us always a delicate operation. You need to know the height of the custom template and then add some white space that matches that height. However: what are you going to do if the content of the custom template doesn't match the page?
I would advise against your plans, and I would recommend another approach.
I am assuming that your custom template is a PdfTemplate object. In that case, you can wrap this object inside an Image object, and use document.add() to add the template.
See for instance: Changing Font on PDF Rotated Text
In this example, we create a PdfTemplate with a bar code and some text:
PdfTemplate template = canvas.createTemplate(rect.getWidth(), rect.getHeight() + 10);
ColumnText.showTextAligned(template, Element.ALIGN_LEFT,
new Phrase("DARK GRAY", regular), 0, rect.getHeight() + 2, 0);
barcode.placeBarcode(template, BaseColor.BLACK, BaseColor.BLACK);
We want to add this template to a document with document.add(), so we wrap the template inside an Image object:
Image image = Image.getInstance(template);
We can now add this image to the document:
document.add(image);
Afterwards, we can add extra content:
Paragraph p3 = new Paragraph("SMALL", regular);
p3.setAlignment(Element.ALIGN_CENTER);
document.add(p3);
That content is added under the template at the right position. You don't need to worry anymore about getting the Y position with getVerticalPosition() and you don't need to worry about setting the Y position after adding the template. If the template doesn't fit on the current page, it will automatically be moved to the next page.
Important: Maybe you are worried about the resolution of your template. You shouldn't be. If the template consists of vector data, wrapping that data inside an Image object won't change it into raster data. The vector data will be preserved. This is important in the bar code example, because you don't want the quality of your bar code to deteriorate by making it a raster image.

add shape dynamically to activereports

I've got a kinda requirement in which there is a kinda graph (static picture) on a page. In that picture I need to plot some points dynamically. That means using a shape filled with blue color. The number of points is floating depending upon the number of applicants choosen. How can I make it work or how can I add new elements to report at runtime. Am working in ASP.nET using VB and the AR version is 6.2
If I have understood your query right,then you want to plot some points depending on the dynamic data.
A suggestion would be to make use of Chart control in report. The chart can be bound to anything from a list to an array and the data can be changed dynamically from time to time.
Moreover,you can set the backcolor and other properties of the Chart control to give a look and feel of your choice.
Regards,
Mohita
Sorry if my question makes any confusion.. Actually I was able to make that. So am just sharing that code if it helpful for someone else.. I put this to the report start event. (We are not permitted to make this in details event)
Dim pic As New DataDynamics.ActiveReports.Picture
pic.Image = System.Drawing.Image.FromFile(HttpContext.Current.Server.MapPath(String.Format("~/images/circle.gif", cl)))
pic.SizeMode = SizeModes.Zoom
Detail1.Controls.Add(pic)

create a pie chart with passing some values

I am making an application in iPad which is based on creating pie chart after detecting marks like 280 out of 400. I have to create pie chart based on that marks which shows total marks and also obtain marks.
If someone has an idea about it please let me know.
Take a look at CorePlot's CPTPieChart class
Refer MIMChart-Library which has differnt styles in each category.

Comment / Note in a JFree Chart

I am looking for a way to insert a specific comment / note in an image created by JFree Chart. The note can be anywhere on the image (png), above or below the chart.
Is there a way to do this?
To add text, addSubtitle() is a common approach, and TextTitle is a convenient implementation of the Title interface.
If you want to create a comment or not on Image itself... you can do this with the use of Marker.
If you want something below the image/graph use the LegendItemCollection.