Aspose.cells How to add differnt Y values in scatter chart - java

Im using aspose.cells for java.
I want to insert two different lines a scatter chart, but they have different both X and Y values. X values is not a problem with
chart.getNSeries().add("C1:C19", true);
but i can set only one CategoryData with
chart.getNSeries().setCategoryData("B1:B19");
Is there any other way to do it (insert columns E1:E19 as Y and D1:D19 as X values) ?
Im searching it of ages, and i cant find a solution.
Thank you.
:)

Well, you may try to specify the x values for a particular data series in the way:
e.g
Sample code:
chart.getNSeries().get(index).setXValues("......");
If you still could not evaluate, kindly provide your current sample code (runnable), template file(s) and your expected file that should contain your desired chart that you may manually create in MS Excel, we will check it soon.
Note: I am working as Developer Evangelist at Aspose

Related

How to determine coordinates of multi-line text in PDF

I am using Apache PdfBox 2.0 in order to parse a pdf file. Having some fixed strings, I was able to create a system based on:
A fixed text, as a starting point
The next cell/text position, or null
The bottom area, to determine the height of the rectangle.
Using the starting point, I am computing the x and y (see below pic for pdf structure in PDF Box:
Using the "next" text block (which is another fixed value, for example a field or a table header), I am determining the width of the desired region, using formula:
width = second.x - first.x
or something similar. So, in a table, for example, knowing in advance the header names, it's easy to detect the columns. What I am trying to do (and so far fail to do so in an accurate way) is to determine the lines in a pdf table. This table sometimes contains missing values in some columns and also multiple lines values for some rows/columns. I have extended my "system" (first, next, bottom) to work dinamycally with table rows, and this works great when I have "normalized" tables (e.g. no whitespaces and/or at least, no multiple line values). But it's not working with real world data, because so far I could not find a way of determining the location (x, y, width, height) of a multi-line value. Is this even possible with PDF Box? Some people suggested to convert the pdf to html first and then to parse the html instead. Is this a viable option? Has anyone worked with this library? I will try to use this next.
Like I said in my previous comments, I have found a partial solution for my issue. This is based on two things:
First, I assume that one column for each table contains only distinct values which never occupy more than 1 row.
Next, since I also have some fixed texts in the document, I have determined these texts coordinates and use them as a delimiter of the area which contains the text I want to extract. For example, the "current, next, bottom" system (as I call it) can contain for example: "Column name A", "Column name B", "Fixed text C" (or second row from the same table - determined based on the unique single-row values).
It is not perfect, and problems may occur if the fixed texts may occur more than once in the document. Of course, improvements can be made by filtering the correct occurrence using the vertical coordinates and so on, but for the moment, I will close this question, as it seems that this problem has no standard answer and currently there is no open source library able to extract tabular data from pdfs.

Petaho kettle Java expression to split cell and duplicate value in excel horizontally

I am using Kettle for data migration for moving data, I come across a scenario where i got a excel where the column header is merged, When i read it only the first cell gets the name others are empty, Kettle can only duplicate values vertically, I have a macro which does the exact same thing, But some one has to do it manually, Is there a java code i could run to achieve this?
What do you mean by merged? In the excel file is there one cell with all the values? Is there a separator? If it's not a great deal of columns I'd just manually add them or change them to what I want using a select step. If you'd like to upload files I'll take a look.
I think, got the solution. Here Java code is not required. Please follow the step to achieve your result.
Step1: Drag and drop Microsoft Excel Input to the canvas.And go to Content uncheck Header.
Step2: Go to !Fields tab. See the below image and fill up like below image.
Step3:Go to Additional output fields tab and then check for sheet row nr field and fill up the check box with row_number.
Step4:Finally, click on preview button. You get the result like below.
If you see the result. First three rows are unnecessary. You can filter those three rows by using Filter step this part I'am not done.

Customize x axis with JfreeChart XYLineChart

I'm displaying the results of a clustering operation on a XYLineChart using JFreeChart. For now the plot I get is this one:
I need to change the x axis in order to get this display:
So basically I first need to get rid of the tick and numbers (this I already searched and found a way to manage how to do it). The problem for me is to add my own custom String values on the x axis AND to have these positionned at specific position. I already have an arraylist with the Strings and another one with the position values, no need to calculate them, i just want to know how to use them with the plot.
Thank you in advance and, as usual, please tell me if my explanation needs to be clarified.
in order to change the content of the display, you need to change your query to have the output you like to see.
to change the position you may need to use something like:
categoryPlot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_90);
you need to show some of your code so that you can get the proper advice

Java POI API - Drawing pie chart in XLS

I have searched for this and implemented it using a template file with sample data and the pie chart in it. I need the following:
I want to add more rows (add more data). Modifying the existing data in the defined data range works fine. (Adding extra row by using shiftRows() did not work)
I want to move the pie chart in the current sheet. I might have the pie chart in a specific position in the template. But, I need to modify the data and need to move it to a different position within the sheet.
If anyone can provide direction on this or point to a working example, it would be really helpful.
NOTE: I want a pure POI solution.
Please check if this can help.
JFreeChart

Syntax for generating Barcode using PCL syntax

Iam searching for a PCL syntax to generate and print the BARCODE. If anyone having any information about the same, please help me. I have tried googling it, but didnt find anything.
First you need a barcode font. Once you have this simply move the cursor to the spot you want (in the example 300 x 300 in whatever unit of measure you've defined), and then call the barocde and put your text down. A simple exmample might look like htis:
<ESC>*p300x300Y<ESC>*c100D1234567890
This assumes that you have embedded the barcode as part of the print job and assigned the numeric 1000 to the font call. Just search the web for "pcl barcode font" and you will find many sites that sell these fonts and provide instructions on how to call. If the printer has barcode fonts embedded, try printing a font list and it should provide the escape sequence you need to call.

Categories

Resources