Quantcast
Channel: Dave Gilbert's Weblog
Viewing all 87 articles
Browse latest View live

Feedback Time!

$
0
0
In Reaching for the Web, I spoke about the SVGGraphics2D implementation I've been working on. Well, I've taken this thing about as far as I can without getting some real-world feedback on it, so I've packaged it up in a new project JFreeGraphics2D and released it. It's taken slightly longer than I planned, because along the way I wondered what it would take to do a PDFGraphics2D implementation and somehow could not put it down. So JFreeGraphics2D 1.0 supports PDF as well as SVG and includes the following key components: An important feature of the library is that it is small, the jar file is just 88kB for PDF and SVG with no external dependencies. I've tested it using JFreeChart and it is working well, but it is definitely going to benefit from some broader usage (especially since JFreeChart doesn't touch all the corners of the Java2D API). Please try it out and send your feedback.

On the license...
JFreeGraphics2D is dual licensed, free under the terms of the GNU Affero General Public Licence plus you can purchase a proprietary license if you are not yet ready for Free Software. Initially the proprietary licenses will be bundled with the JFreeChart Developer Guide and Demo Source Code, to encourage companies to support our work more than just in spirit.


Trends

Powerless / Galaxy Nexus S

$
0
0
For the last couple of days, my Galaxy Nexus S has been going to sleep and not waking up again (restarting required either removing the battery, or plugging in and removing the charger, which is not so convenient). Then I noticed that when the phone is on, I cannot switch it off. It turns out the ON/OFF switch has failed and I am not alone.

The point of this post is just to say, this video has provided a tolerable workaround to the problem so thanks to Ryan Lowe for going to the trouble of posting it.

Coming in JFreeChart 1.0.16

$
0
0
It's my plan to release JFreeChart 1.0.16 this month. In the two months since 1.0.15 was released, during this time there have been almost 30,000 downloads...my current challenge is to convert a greater percentage of these downloaders into paying / contributing customers (more about that later, but rest assured there is no license change planned for JFreeChart).

Over the summer I've created two new lightweight libraries (JFreeSVG and OrsonPDF) that provide fast and easy creation of charts (and any other Graphics2D output) in SVG and PDF format. Previously that has required the use of Apache's Batik and Bruno Lowagie's iText, both really great libraries but dependencies that carry a certain "weight" with them. JFreeChart 1.0.16 will make use of JFreeSVG and OrsonPDF out-of-the-box when they are present on the class path...and in addition I hope that developers will find uses for these libraries independently of JFreeChart (full disclosure: these libraries are less "free" than JFreeChart :-) , you can expect more of this from me).

While you're here, let me draw attention to another small feature coming in JFreeChart 1.0.16 - support for AttributedStrings in axis labels. Here is a simple example where the label can include a super-script (there's more you can do with attributed strings, but this is a good use-case):

newfeature.png

I don't know why I didn't add this many years ago...but in any case, it is coming in 1.0.16. And I'll show you the rest of the chart later, which is quite an interesting visualisation of the amount of water used by the top 20 water-consuming countries. [Please, if you have some interesting data, let me know ... I'm in the process of updating the JFreeChart demo charts to use more real data].

JFreeChart 1.0.16 / JFreeSVG 1.2 / OrsonPDF 1.2

$
0
0
Today I released three projects simultaneously. First up, JFreeChart 1.0.16 is out. This release includes some new features (axis label improvements, simplified ChartFactory methods, utility methods to interpolate y-values in XYDatasets, CategoryAxis URL support in image maps) that were added in the two months since the previous release, a few important bug fixes, and a bit of clean-up that's possible now that we've dropped support for JDKs 1.4.2 and 1.5 (you're going to need 1.6.0 or later going forward).

Next, I've updated both JFreeSVG and OrsonPDF. These libraries (which provide fast and lightweight SVGGraphics2D and PDFGraphics2D implementations) can be used with JFreeChart or indeed any Java application that uses Java2D. I updated JFreeChart's ChartPanel class to auto-detect these libraries on the classpath and provide options to save charts to SVG and PDF, as seen in this screenshot:

chartpanel.png

If the libraries are not on your classpath, the export to SVG and PDF options won't be shown. Now, you'll notice that JFreeSVG and OrsonPDF are not as "free-as-in-beer" as JFreeChart. That's intentional...if you want to use these libraries in your applications, you'll need to buy a license. The good news is that, during September and October 2013 the licenses will be included free-of-charge with all purchases of the JFreeChart Developer Guide. So buy the guide, and help keep JFree alive!

JFreeSVG 1.4 / JCommon 1.0.21

$
0
0
Today I released JFreeSVG 1.4 and JCommon 1.0.21 to improve the quality of text rendering when generating charts in SVG format with JFreeChart. Rather than the usual screenshot, here's the SVG output for one of the sample charts:

Projected Values - TestSeries 1Series 2Nov-2013Jan-2014Mar-2014May-2014Jul-2014Sep-2014Date9293949596979899100101102103104105106Index Projection

If the chart doesn't render well for you, please let me know the browser and system you are using, because I'm interested.

Orson Charts 3D

$
0
0
Today I am releasing a new product, Orson Charts, a 3D chart library for the Java(tm) platform:



Orson Charts supports a range of different chart types, and has a built-in pure Java rendering engine that requires only Java2D's Graphics2D API. This means that Orson Charts is easily deployed (no OpenGL or Java3D dependencies to worry about) and that 3D charts can easily be exported to PDF and SVG format using other libraries (for example Orson PDF and JFreeSVG, or iText and Batik). People that are familiar with the JFreeChart API will find the Orson Charts API very similar in style and, in fact, Orson Charts makes a perfect companion to JFreeChart.



Orson Charts features a very nice viewer for use in Swing applications providing zooming and full 360 degree rotation of the charts in any direction. I encourage you to download the free evaluation copy and run the demo programs to see this in action.

Orson Charts is not open source. I want this project to be self-sustaining and it's my judgement that charging money for it is the best way to fund ongoing development. Please download the free evaluation copy of Orson Charts, try out the demo application, look through the API, send me your feedback...and buy it!

JFreeChart 1.0.17

$
0
0
Today JFreeChart 1.0.17, a free/open source chart library for the Java platform (1.6 or later), is available for download. This release adds a notify flag to all datasets, key validation for the time series dataset, area fills for the XYSplineRenderer, a new axis label formatter, improvements in rotated text code, and numerous bug fixes.

scatterplot.png

I can't believe it's almost 14 years now since I started working on this project. Thanks to everyone that has helped along the way.

Creating 3D Charts in Java is Simple

$
0
0
I want to show how easy it is to create 3D charts in a Java application, so here I will walk through the steps to create the following chart in a small Java Swing application:



The chart shows the number of survivors and non-survivors from the sinking of the Titanic, split between men vs women/children, and broken down by passenger class (1st, 2nd, 3rd and crew). The source of the data is this paper (PDF). The background image is from iStockPhoto.com.

The chart library I'm using is Orson Charts, which comes in a single jar file (248kB) and uses its own built-in 3D rendering (so there is no dependency on JOGL, Java3D etc). It's made to be simple. It's not free.

The first step in creating this chart is to get the data in a form that can be used to create a bar chart (in fact, a stacked bar chart in this case). In Orson Charts, we've defined the CategoryDataset3D interface as the source for data, and provide an easy-to-use implementation StandardCategoryDataset3D (people that have used JFreeChart, another chart library I developed, will find this approach very familiar). Here's the code to create the dataset---for each value we are specifying the series key (one series for survivors, another series for victims), a row key (men vs women/children) and a column key (passenger class):

    private static CategoryDataset3D createDataset() {
        StandardCategoryDataset3D dataset = new StandardCategoryDataset3D();
        dataset.addValue(146, "Survivors", "Women/Children", "1st");
        dataset.addValue(104, "Survivors", "Women/Children", "2nd");
        dataset.addValue(103, "Survivors", "Women/Children", "3rd");
        dataset.addValue(20, "Survivors", "Women/Children", "Crew");
        dataset.addValue(57, "Survivors", "Men", "1st");
        dataset.addValue(14, "Survivors", "Men", "2nd");
        dataset.addValue(75, "Survivors", "Men", "3rd");
        dataset.addValue(192, "Survivors", "Men", "Crew");
        dataset.addValue(4, "Victims", "Women/Children", "1st");
        dataset.addValue(13, "Victims", "Women/Children", "2nd");
        dataset.addValue(141, "Victims", "Women/Children", "3rd");
        dataset.addValue(3, "Victims", "Women/Children", "Crew");
        dataset.addValue(118, "Victims", "Men", "1st");
        dataset.addValue(154, "Victims", "Men", "2nd");
        dataset.addValue(387, "Victims", "Men", "3rd");
        dataset.addValue(670, "Victims", "Men", "Crew");
        return dataset;
    }
Take a look again at the screenshot to see how these data items correspond to the items in the chart (the series keys are shown in the legend, the row keys on the z-axis, the column keys on the x-axis, and the values are plotted against the y-axis).

Next, we will create a Chart3D object configured with the required plot and renderer to create a stacked bar chart from this data. Here the Chart3DFactory class does all the work for us (we just specify the chart title, subtitle, dataset, and axis labels---we pass null for the row axis because it doesn't need a label):
        CategoryDataset3D dataset = createDataset();
        Chart3D chart = Chart3DFactory.createStackedBarChart("The Sinking of the Titanic", "Survival data for 2,201 passengers", 
                dataset, null, "Class", "Passengers");
At this point, the chart is ready to use. We're going to display this one in a Swing UI using the ChartPanel3D class...but first we will make a few customisations of the default settings (add a background image, make the chart walls transparent, and change the bar colors).

The background image is added with the following code, which specifies the image and how it should be resized to fit the background (obviously the image is coming from a file on my desktop, so you should not use this code without modifying the image source):
        ImageIcon icon = new ImageIcon("/Users/dgilbert/Desktop/iStock_000003105870Small.jpg"); 
        RectanglePainter background = new StandardRectanglePainter(Color.WHITE, 
                icon.getImage(), new Fit2D(TitleAnchor.CENTER, 
                Scale2D.SCALE_BOTH));
        chart.setBackground(background);
The Fit2D class allows control over the positioning and scaling of the image. The code here centers the image and scales it to fit the background rectangle (as I write this, I realise I can simplify the API here...that will get done in the next release).

Next, I make the chart-box (the walls of the 3D plot) transparent so that the background image is not completely obscured by the chart---to do this, just specify a color with an alpha-value of less than 255:
        chart.setChartBoxColor(new Color(255, 255, 255, 155));
Finally, I change the default bar colors by customising the renderer. This will need a little bit of explaining:
        CategoryPlot3D plot = (CategoryPlot3D) chart.getPlot();
        StackedBarRenderer3D renderer = (StackedBarRenderer3D) plot.getRenderer();
        renderer.setColorSource(new StandardCategoryColorSource(
                new Color[] { new Color(50, 200, 50), 
                new Color(200, 50, 50) }));
In Orson Charts, the Chart3D class is the top-level "umbrella" object and it keeps a reference to a Plot3D instance which in turn manages the dataset and renderer. There are different types of plots (PiePlot3D, CategoryPlot3D and XYZPlot)...our stacked bar chart uses the CategoryPlot3D class so we first get a reference to the plot (applying the necessary cast---you can check the Chart3DFactory documentation to know what sort of plot your chart is using). The plot has a renderer---the type of renderer controls how the data is represented (bars, lines, areas etc). In our case the renderer is a StackedBarRenderer3D, so we get a reference to this and again apply the necessary cast. Now we can apply whatever customisations we want to the renderer. In fact, here we just set the color source to use two custom shades of red and green for the series colors (once again, as I write this I can see the need to simplify the API here for the easy cases...look for that in the next release also).

Now we add the chart to our Swing UI using the ChartPanel3D class (and, in fact, we wrap that inside a DisplayPanel3D to get the toolbar that you see in the screenshot). The call to zoomToFit() just ensures that the chart is sized to fit the available space in the panel:
        ChartPanel3D chartPanel = new ChartPanel3D(chart);
        chartPanel.zoomToFit(OrsonChartsDemo.DEFAULT_CONTENT_SIZE);
        content.add(new DisplayPanel3D(chartPanel));
And that's it. The complete source for the demo is here (there's very little code in addition to what I've already shown you). I encourage you to download the free evaluation for Orson Charts, run the demos, and see for yourself how easy it is to create great looking 3D charts in Java.

Orson Charts 3D / Android

$
0
0
For the last couple of weeks I've been working simultaneously on an update to the Orson Charts library for Java that was released in November, and a new version that will run on Android. Progress on the Android version has been faster than I'd estimated, and I expect to get this polished into an initial public release during next week:

android_surface_50.png

Note that the surface plot above will also be included in the next release of the Java version, along with performance improvements that came out of the Android work, some legend positioning enhancements, and various API improvements.

android_pie_50.png

Like in the Java version all the rendering is done in software (for Android, using the Canvas API on a SurfaceView), and the the basic touch events for rotation and pinch-zooming are working nicely. Performance is good too, on a range of devices (I've tested using a recent Nexus 7 tablet, an almost 3 year old Nexus S phone, and a recent mid-range LG smart phone (E460 Optimus L5 II)). If you'd like to try it out please download OrsonChartDemo.apk (130kB) and run it on your own device. I'll get something on Google Play as soon as I can, but in the meantime your feedback is very welcome!

android_stackedbar_50.png



Orson Charts 3D / Google Play

$
0
0
Last week I set up a developer account for the Google Play store and uploaded the demo application for Orson Charts 3D. Hats off to Google, this was a very smooth and fast process. Here's the link if you want to try the demo:

https://play.google.com/store/apps/details?id=com.orsoncharts.android.demo

I'll be taking a short break for Christmas celebrations, then working hard on more features and more interactivity for the first Orson Charts release in 2014. Merry Christmas to everyone!

Baking Little Features

$
0
0
Now that the core features are present in Orson Charts, my new 3D chart library for Java and Android, I'm putting efforts into the little features that will give the library greater polish. To give an example, in the upcoming version 1.2 release I'll be adding label generators for pie section labels, category axis labels and legend item labels. These label generators will allow extra information to be included with chart labels based on templates. In the pie chart below, the percentage for each data item is shown in the legend:

pie3d.png

The code is straightforward (and similar in the case of category or xyz plots):
PiePlot3D plot = (PiePlot3D) chart.getPlot();
plot.setLegendLabelGenerator(new StandardPieLabelGenerator(PERCENT_TEMPLATE));
For those that like to venture deeper into the API, the generators process label templates using java.util.Formatter, so there is a great deal of flexibility in the content and format of the labels. The generators also have access to the full dataset at the point that labels are created, so a custom generator can compute any data metric (min, max, mean etc) for inclusion in labels.

We're also working with a client on a chart styling feature, so that you can easily choose a style or theme for your charts (or create your own). This should also make it into the version 1.2 release. I'll write a separate blog post about it later, because I've found some interesting and useful resources for colors and fonts...stay tuned.

If you need help to improve the data visualisation capabilities of your Java or Android applications, I can help you. Please see my consulting page.

On Chart Colors

$
0
0
Choosing a good color palette for charts is surprisingly hard. I largely ignored the issue for JFreeChart, assuming that developers would take the initiative and make use of the (very flexible) API to make their charts look great. That rarely happened, because developers are too lazy or too busy or too stupid (or too smart in some cases) to venture far beyond the defaults given to them by an API. I understand this now, and will take steps.

For Orson Charts, I decided I had to make more effort, so I started researching and experimenting. Progress was not linear, it has to be said, but I made a great break-through when I found this tool from médialab at Sciences Po in Paris (try it, it is amazing!):

i want hue

"Colors for data scientists. Generate and refine palettes of optimally distinct colors."

iwanthue.png

I have not found any better tool to create color palettes for charts, and so I'm currently working on incorporating these into JFreeChart and Orson Charts. Here are some examples from the work in progress:

hue_bar2.png

hue_pie.png

hue_bar.png

Tell me what you think!

If you need help to improve the data visualisation capabilities of your Java or Android applications, I can help you. Please see my consulting page.

Eleven Foot Pole

$
0
0

This week I've taken Google's Dart programming language by the horns and ported Orson Charts (or at least large chunks of it) to “the browser”. I'm only going to show you a screenshot on this blog, so if you want to see this “live” please click the image (or go to http://www.object-refinery.com/orsoncharts/dart/poc.html)...and then tell me which browsers this is broken on. In fact I tested it on Chrome, Safari and Firefox on my laptop, so I think it should work for a lot of people. The implementation renders charts to a canvas element, and performance is good considering that the 3D rendering is done in software (Javascript, no less).

In case it is not obvious, you can rotate the charts by a mouse drag (or touch on mobile devices) and zoom by mouse wheel. There is no pinch zoom for mobile yet, but it will be done. There's still polishing to do on this code, I only started working on the port on Monday (5 days ago), but eventually it will be released as a product alongside the Java and Android editions of Orson Charts.

orson_charts_dart_edition.png

If you have any questions, don't hesitate to contact me (david.gilbert@object-refinery.com). And have a good weekend!

Orson Charts for HTML5

$
0
0
Back in the day, one of the Java slogans was "write once, run everywhere", and for a while it was quite close to being true. But not anymore. Java doesn't have much client-side presence in the browser anymore, nor has it made much ground on mobile devices. So for Orson Charts, I've employed a "write three times, run everywhere" approach. There is a Java version, an Android version and, now, a Javascript/HTML5 version. I could go a step further and write an Objective C version as well, but...not right now.

In fact, the Javascript/HTML5 version isn't directly written in Javascript. I ported the Java code to Google's Dart programming language, and then compiled to Javascript. Much easier! The porting effort took three weeks, including creating the web pages and writing the documentation.

The Dart team posted a screenshot of our web page with a "Built with Dart" annotation, on Google+:

built_with_dart.png

It's getting some visibility, which is great, and while it is doing the rounds I will get to work on the next releases.


The Art of Brick

$
0
0
Earlier this month I attended FOSDEM in Brussels, which was excellent as usual. On Sunday morning, I took a little diversion and went to Nathan Sawaya's The Art of Brick at the Bourse. I'll show you a couple of photos, even if they don't really do justice to the exhibits. I liked this one because I feel like this sometimes when I work really hard on something:

rip.jpg

And this one I went back to a few times, it's hard to believe it's just plastic bricks:

myboy.jpg

You should go see this if you get the chance.

3D Charts in SVG

$
0
0

When I released Orson Charts for HTML5 a couple of weeks back, one of the immediate questions was why I used HTML5 Canvas for the rendering instead of SVG. The main reasons for choosing Canvas were that (1) the code was being ported from the original Java version of Orson Charts and the Java2D rendering used there maps easily to the Canvas API in HTML5, and (2) I guessed that the Canvas rendering would be faster than building an SVG element in the DOM.

That said, the final 2D rendering of the charts is nicely separated from the rest of the code, so it isn't difficult to provide alternative rendering paths. For the next release, I've added an option to render to SVG - click on the image below to try out the live demo.

surface_svg.png

The performance is better than I expected, it is perfectly usable on my laptop although it is noticeably slower in Firefox compared to Chrome and Safari. I didn't run any performance metrics yet to compare the Canvas and SVG versions, but the Canvas version still feels faster. This isn't released yet because there is still an issue with the vertical positioning of text...getting font metrics isn't as easy as it should be and I still have to find a (lightweight) workaround for that. But it is coming soon!

Ring Plot with JFreeChart

$
0
0

I found this lying on my hard drive from a while back - it's a simple ring chart with text in the middle, created using JFreeChart:

ring_plot_demo.png

The code (see below) requires a small extension to RingPlot which can be done by subclassing. I remember saying (or thinking) I would make a small change to JFreeChart so this type of chart can be produced without the need to subclass...that's done and it will be in the upcoming 1.0.18 release. The code below runs, of course, with the current release (1.0.17).

/* -------------------
 * RingChartDemo1.java
 * -------------------
 * (C) Copyright 2014, by Object Refinery Limited.
 * 
 * http://www.object-refinery.com
 */

package org.jfree.chart.demo;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.geom.Rectangle2D;
import javax.swing.JPanel;

import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PiePlotState;
import org.jfree.chart.plot.RingPlot;
import org.jfree.chart.title.TextTitle;
import org.jfree.data.general.DefaultPieDataset;
import org.jfree.data.general.PieDataset;
import org.jfree.text.TextUtilities;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.HorizontalAlignment;
import org.jfree.ui.RectangleInsets;
import org.jfree.ui.RefineryUtilities;
import org.jfree.ui.TextAnchor;

/**
 * A simple demonstration application showing how to create a ring chart using
 * data from a {@link DefaultPieDataset}.
 */
public class RingChartDemo1 extends ApplicationFrame {

    private static final long serialVersionUID = 1L;

    /**
     * A subclass of RingPlot that adds a text entry in the middle of the 
     * ring showing the value of the first data item.
     */
    static class CustomRingPlot extends RingPlot {

        /** The font. */
        private Font centerTextFont; 
        
        /** The text color. */
        private Color centerTextColor;
        
        /**
         * Creates a new ring plot for the specified dataset.
         * 
         * @param dataset  the dataset. 
         */
        public CustomRingPlot(PieDataset dataset) {
            super(dataset);
            this.centerTextFont = new Font(Font.SANS_SERIF, Font.BOLD, 24);
            this.centerTextColor = Color.LIGHT_GRAY;
        }
        
        /**
         * Draws one item for the plot and, when drawing the first section,
         * adds the center text.
         * 
         * @param g2  the graphics target (null not permitted).
         * @param section  the section index.
         * @param dataArea  the data area (null not permitted).
         * @param state  the plot state.
         * @param currentPass  the current pass index.
         */
        @Override
        protected void drawItem(Graphics2D g2, int section, 
                Rectangle2D dataArea, PiePlotState state, int currentPass) {
            super.drawItem(g2, section, dataArea, state, currentPass);
            if (currentPass == 1 && section == 0) {
                Number n = this.getDataset().getValue(section);
                g2.setFont(this.centerTextFont);
                g2.setPaint(this.centerTextColor);
                TextUtilities.drawAlignedString(n.toString(), g2, 
                        (float) dataArea.getCenterX(), 
                        (float) dataArea.getCenterY(),  
                        TextAnchor.CENTER);
            }
        }
    }
    /**
     * Default constructor.
     *
     * @param title  the frame title.
     */
    public RingChartDemo1(String title) {
        super(title);
        setContentPane(createDemoPanel());
    }

    /**
     * Creates a sample dataset.
     *
     * @return A sample dataset.
     */
    private static PieDataset createDataset() {
        DefaultPieDataset dataset = new DefaultPieDataset();
        dataset.setValue("A", new Double(210));
        dataset.setValue("B", new Double(150));
        return dataset;
    }

    /**
     * Creates a chart.
     *
     * @param dataset  the dataset.
     *
     * @return A chart.
     */
    private static JFreeChart createChart(PieDataset dataset) {
        CustomRingPlot plot = new CustomRingPlot(dataset);
        JFreeChart chart = new JFreeChart("Custom Ring Chart", 
                JFreeChart.DEFAULT_TITLE_FONT, plot, false);
        chart.setBackgroundPaint(new GradientPaint(new Point(0, 0), 
                new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY));

        // customise the title position and font
        TextTitle t = chart.getTitle();
        t.setHorizontalAlignment(HorizontalAlignment.LEFT);
        t.setPaint(new Color(240, 240, 240));
        t.setFont(new Font("Arial", Font.BOLD, 26));

        plot.setBackgroundPaint(null);
        plot.setOutlineVisible(false);
        plot.setLabelGenerator(null);
        plot.setSectionPaint("A", Color.ORANGE);
        plot.setSectionPaint("B", new Color(100, 100, 100));
        plot.setSectionDepth(0.05);
        plot.setSectionOutlinesVisible(false);
        plot.setShadowPaint(null);

        return chart;

    }

    /**
     * Creates a panel for the demo (used by SuperDemo.java).
     *
     * @return A panel.
     */
    public static JPanel createDemoPanel() {
        JFreeChart chart = createChart(createDataset());
        chart.setPadding(new RectangleInsets(4, 8, 2, 2));
        ChartPanel panel = new ChartPanel(chart);
        panel.setMouseWheelEnabled(true);
        panel.setPreferredSize(new Dimension(600, 300));
        return panel;
    }

    /**
     * Starting point for the demonstration application.
     *
     * @param args  ignored.
     */
    public static void main(String[] args) {
        RingChartDemo1 demo = new RingChartDemo1("JFreeChart: Ring Chart Demo 1");
        demo.pack();
        RefineryUtilities.centerFrameOnScreen(demo);
        demo.setVisible(true);
    }

}

Orson PDF 1.5

$
0
0
Today I released version 1.5 of Orson PDF, a fast and small PDF generator for Java (it implements the Graphics2D API). I created this library last year because I wanted to provide export to PDF for both JFreeChart and Orson Charts, but without taking on a big external dependency:

popup_pdf.png

The Orson PDF jar file weighs in at less than 70kB (without using Pack200 or any other minimisation techniques). It doesn't support font embedding, but the latest release provides an option (enabled via rendering hints) to render text as vector graphics, which works pretty well when the amount of text is limited as is usually the case with charts.

If you are working with Java2D, you should also check out JFreeSVG, I released a new version of that library last week. It does SVG generation via the Graphics2D API and is, like Orson PDF, very light-weight (around 48k for the jar file).

Orson Charts 1.2

$
0
0
I just released a new version of Orson Charts, a 3D chart library for the Java platform. Version 1.2 contains significant new features driven by customer requirements:
  • logarithmic axis support;
  • value and range markers for all numerical axes (to match a similar feature in JFreeChart);
  • localisation support (with German and Italian localisations initially);
  • improved axis labelling with new tick label orientation options plus "stepped" labelling for category axes;
  • chart theme support, with some built-in themes plus the ability to create your own;
  • a JPEG export option (to add to the existing PNG, PDF and SVG export options).

In this release, we've also made efficiency improvements in the rendering engine and fixed a number of bugs that have been identified by clients and through our own testing (the recent exercise of creating the Orson Charts for HTML5 port uncovered a few issues, for example).

I can't have a blog post without a few screenshots so first up here is an example of the logarithmic axis (on the y-axis here, but it is possible to use a log scale on any numerical axis):

ScatterPlot3DDemo2_2.png

Next up, an example showing the highlighting that can be done with the new marker feature (see that the categories "Apple" and "Q4/12" have been highlighted, plus the bar is rendered in red to draw attention to that particular data value...Apple makes a *lot* of money, but you already knew that):

CategoryMarkerDemo1.png

Finally, some range markers on an XYZ plot to highlight particular ranges of values (and a custom color source to highlight those items that fall within the intersection of the three ranges). The most typical usage would be to show a range of y-values in some target range, but for demo purposes the example below adds a range marker to each axis:

RangeMarkerDemo1.png

Our focus for the next release is to continue improving the interactivity of the charts. While we are working on that, please go and download the free evaluation of Orson Charts 1.2 and send us your feedback.

Viewing all 87 articles
Browse latest View live