Java Code Examples for org.jfree.chart.urls.StandardPieURLGenerator#generateURL()

The following examples show how to use org.jfree.chart.urls.StandardPieURLGenerator#generateURL() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StandardPieURLGeneratorTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Test that the generated URL is as expected.
 */
public void testURL() {
    DefaultPieDataset dataset = new DefaultPieDataset();
    dataset.setValue("Alpha '1'", new Double(5.0));
    dataset.setValue("Beta", new Double(5.5));
    StandardPieURLGenerator g1 = new StandardPieURLGenerator(
            "chart.jsp", "category");
    String url = g1.generateURL(dataset, "Beta", 0);
    assertEquals("chart.jsp?category=Beta&pieIndex=0", url);
    url = g1.generateURL(dataset, "Alpha '1'", 0);
    assertEquals("chart.jsp?category=Alpha+%271%27&pieIndex=0", url);
}
 
Example 2
Source File: StandardPieURLGeneratorTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Test that the generated URL is as expected.
 */
public void testURL() {
    DefaultPieDataset dataset = new DefaultPieDataset();
    dataset.setValue("Alpha '1'", new Double(5.0));
    dataset.setValue("Beta", new Double(5.5));
    StandardPieURLGenerator g1 = new StandardPieURLGenerator(
            "chart.jsp", "category");
    String url = g1.generateURL(dataset, "Beta", 0);
    assertEquals("chart.jsp?category=Beta&pieIndex=0", url);
    url = g1.generateURL(dataset, "Alpha '1'", 0);
    assertEquals("chart.jsp?category=Alpha+%271%27&pieIndex=0", url);
}