Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Birt Chart Line Plot problem
dredd
Hello everybody,
I have the following problem. I have a lot of x/y-data (over 600000 per graph) that needs to be displayed in a chart.
Principal there are two chart types that would fit:
Scatter Plot and Line Plot.
The data are special since it is not just a normal x/y-plot, it is the outline of the surface of a tire.
So there are multiple data for a single x-value for drawing the outline.
The scatter plot works fine, but the markers are to big (even with the size 1) and in some points there are to less data for a graphi without gaps.
So naturally the line plot would save the day. But with this data the chart looks like a piece of string art with lines all over the place. So obviously the line chart does not draw the lines in the same order as the SQL shows the results.
How can I make the line plot chart work?
Best regards
Find more posts tagged with
Comments
mwilliams
Someone else, whom I assume works with you, asked this same question with the same images. With the scatter plot, does it not work to make the marker not visible and then just use the connecting line? It should connect them in the correct order, unlike your line chart, I believe. Could you send me a csv of data that I can use to recreate this?
dredd
I have added a zip-file that contains a rptdesign-file and some data CSVs.<br />
It should be extracted to d:\, then it will works without any problems.<br />
<br />
One csv-file contains the data for both graphs, the other two csv-files data for either graphs.<br />
<br />
So long as only one graph is shown, the graph looks fine. But when two graphs are shown<br />
which are grouped, then you will notice the problem.<br />
<br />
By the way, I am using BIRT 2.6.2.<br />
<br />
Thanks in adavance!<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="105455" data-time="1340982919" data-date="29 June 2012 - 08:15 AM"><p>
Someone else, whom I assume works with you, asked this same question with the same images. With the scatter plot, does it not work to make the marker not visible and then just use the connecting line? It should connect them in the correct order, unlike your line chart, I believe. Could you send me a csv of data that I can use to recreate this?<br /></p></blockquote>
mwilliams
Here's what I get when I do what I told you above:
dredd
Yes, that looks better. But is there a way to get rid off the faulty vertical lines?
The result should look like these two separate graphs down below put on top of each other.
Best regards
mwilliams
What about this? This is a size 0 embedded image for the marker with no line:
dredd
SO, I finally solved the problem by finding a workaround for - what I suspect - a bug.
The workaround itself consists out of four measures:
1. Deactivate the "connect missing values" checkbox as described above (thanks for your tipp)
2. Reduce the amount of data (mod(id,2) = 1) within the sql
3. Bring the x/y values into a correct order within the sql
4. Make every x/y pair unique by altering each x-value by using a synthetic slightly different x-value (computed column) for the chart
So, the 2. and 3. are done within a sql statement:
select id, speed, x, y
from data
where mod(id,2) = 1
order by id asc
The table data contains the x/y data.
It is important that every x/y pair has an ongoing unique number (here it is called id), which represents the correct order of the data. So I ordered the data according to this id.
But the Birt Line Chart had still problems with the representation. My guess was it has something to do with the mutiple y-values for one x-value.
In fact, the data constellation seems a little bit more complicated as said.
So I added the following computed column which I used further instead of the original x-value:
row["X"]+1/(100*row["ID"])
So I added a small number to the original x-position, and after that the representation was as expected.
"Another job well done!" as Prof. Farnsworth might have added.
mwilliams
Seems like a lot of work! I just made 1 pixel images of the colors I wanted to use and changed out the marker image for each series in script in my scatter plot. With an image, if you set the size to 0, it still shows the dot. I can attach that report, if you'd like to see it. If you're ok with the current way, then there's no need to change it! Glad you got something to work. You can always file a bug for this at
http://www.eclipse.org/birt/phoenix/reportabug.php