ICEfaces
  1. ICEfaces
  2. ICE-4087

Add scatter chart to charts component

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8RC1
    • Fix Version/s: 1.8RC2, 1.8
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)

      Description

      Add XY Scatter Chart to the ICEfaces chart component.
       
      http://jcharts.sourceforge.net/samples/scatter.html

      1. AxisChart.java
        13 kB
        Keith Garry Boyce
      2. AxisChart.java
        13 kB
        Tyler Johnson
      3. OutputChart.java
        22 kB
        Tyler Johnson
      1. chart.jpg
        12 kB

        Activity

        Hide
        Tyler Johnson added a comment -

        Attached are the customer's source files that implement this functionality. For instance:

        <ice:outputChart id="axialOutputChart"
        type="scatterplot"
        actionListener="#

        {clientHandler.chartAreaClicked}

        "
        chartTitle="ScatterPlot"
        xaxisTitle="x axis"
        yaxisTitle="y axis"
        renderOnSubmit="true"
        xaxisLabels="-5,3,10,0,-30,50,10,1"
        labels="Test1,Test2"
        data="0,0,4,120,10,220:16,70,19,70"
        width="450" height="300"/>

        Show
        Tyler Johnson added a comment - Attached are the customer's source files that implement this functionality. For instance: <ice:outputChart id="axialOutputChart" type="scatterplot" actionListener="# {clientHandler.chartAreaClicked} " chartTitle="ScatterPlot" xaxisTitle="x axis" yaxisTitle="y axis" renderOnSubmit="true" xaxisLabels="-5,3,10,0,-30,50,10,1" labels="Test1,Test2" data="0,0,4,120,10,220:16,70,19,70" width="450" height="300"/>
        Hide
        Adnan Durrani added a comment -

        Provided patch applied.

        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputchart\AxisChart.java
        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputchart\OutputChart.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputchart\OutputChart.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputchart\AxisChart.java
        Completed: At revision: 18394

        Show
        Adnan Durrani added a comment - Provided patch applied. Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputchart\AxisChart.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputchart\OutputChart.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputchart\OutputChart.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputchart\AxisChart.java Completed: At revision: 18394
        Hide
        Keith Garry Boyce added a comment -

        I found a few issues with what i previously submitted. So thought i'd update it here just in case you didn't find them. specifically look for garpinc in source for changes.. changes are related to using NaN for points not to be displayed, using 2DoubleArray.

        Show
        Keith Garry Boyce added a comment - I found a few issues with what i previously submitted. So thought i'd update it here just in case you didn't find them. specifically look for garpinc in source for changes.. changes are related to using NaN for points not to be displayed, using 2DoubleArray.
        Hide
        Keith Garry Boyce added a comment -

        Perhaps you also have a good way of meeting this request:

        for each point I need the title to be more flexible than just a now currently hard coded legend.

        for each point instead I want to be able to specify a title format like

        {legend} ({pointLabels}) {xLabel} = {xValue}, {yLabel} = {yValue}

        usage as follows:

        <ice:outputChart
        pointLabelsMethod="${managedBean.pointLabels}"
        pointTitleFormat="{legend}

        (

        {pointLabels}

        ):

        {xLabel}

        =

        {xValue}

        ,

        {yLabel}

        =

        {yValue}

        "

        resulting in a title like:

        Label0 (1,2): xaxis = 25.0, yaxis = 50.0

        and where this would indicate that at 25,50 coordinate there are two points with the very same coordinates with labels "1" and "2"

        and "1" and "2" are derived by calling managedBean.pointLabels method passing in the x and y coordinate for the point.

        one way of passing x and y is having managedBean.pointLabels be a map where the first get just sets x value and returns another map where the get of y value sets y and then the final Set of labels is returned from the final get call.

        Show
        Keith Garry Boyce added a comment - Perhaps you also have a good way of meeting this request: for each point I need the title to be more flexible than just a now currently hard coded legend. for each point instead I want to be able to specify a title format like {legend} ({pointLabels}) {xLabel} = {xValue}, {yLabel} = {yValue} usage as follows: <ice:outputChart pointLabelsMethod="${managedBean.pointLabels}" pointTitleFormat="{legend} ( {pointLabels} ): {xLabel} = {xValue} , {yLabel} = {yValue} " resulting in a title like: Label0 (1,2): xaxis = 25.0, yaxis = 50.0 and where this would indicate that at 25,50 coordinate there are two points with the very same coordinates with labels "1" and "2" and "1" and "2" are derived by calling managedBean.pointLabels method passing in the x and y coordinate for the point. one way of passing x and y is having managedBean.pointLabels be a map where the first get just sets x value and returns another map where the get of y value sets y and then the final Set of labels is returned from the final get call.
        Hide
        Keith Garry Boyce added a comment -

        Also:
        in OutputChart there appears to be a problem with imagemap and data sets with conflicting (i.e: equal datapoints). I got all kinds of hanging and also where it worked in Firefox albiet slow it completely hung in ie.

        It cannot be handled at the data level since for instance you want to show a polygon and a circle to indicate there are 2 points. But when calulating the image map these duplicate points should be suppressed.. i.e:

        Set coordinates = new HashSet();
        while (area.hasNext()) {

        ImageMapArea areaMap = (ImageMapArea) area.next();
        StringBuffer coordinateBuf = new StringBuffer();
        areaMap.getCoordinates(coordinateBuf);
        //garpinc only add if coordinate has not already been added.
        if (coordinates.add(coordinateBuf.toString())) {

        Show
        Keith Garry Boyce added a comment - Also: in OutputChart there appears to be a problem with imagemap and data sets with conflicting (i.e: equal datapoints). I got all kinds of hanging and also where it worked in Firefox albiet slow it completely hung in ie. It cannot be handled at the data level since for instance you want to show a polygon and a circle to indicate there are 2 points. But when calulating the image map these duplicate points should be suppressed.. i.e: Set coordinates = new HashSet(); while (area.hasNext()) { ImageMapArea areaMap = (ImageMapArea) area.next(); StringBuffer coordinateBuf = new StringBuffer(); areaMap.getCoordinates(coordinateBuf); //garpinc only add if coordinate has not already been added. if (coordinates.add(coordinateBuf.toString())) {
        Hide
        Ken Fyten added a comment -

        Keith, please create new JIRA issues for these follow-up bugs not related to adding the scatter chart support.

        Show
        Ken Fyten added a comment - Keith, please create new JIRA issues for these follow-up bugs not related to adding the scatter chart support.
        Hide
        Adnan Durrani added a comment -

        Keith Garry`s patch applied. Changes are related to using NaN for points not to be displayed, using 2DoubleArray

        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputchart\AxisChart.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputchart\AxisChart.java
        Completed: At revision: 18621

        Show
        Adnan Durrani added a comment - Keith Garry`s patch applied. Changes are related to using NaN for points not to be displayed, using 2DoubleArray Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputchart\AxisChart.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\outputchart\AxisChart.java Completed: At revision: 18621
        Hide
        Christophe Taverne added a comment -

        Hi,

        Is it possible to add the radar chart too ?

        Regards,

        Show
        Christophe Taverne added a comment - Hi, Is it possible to add the radar chart too ? Regards,

          People

          • Assignee:
            Unassigned
            Reporter:
            Tyler Johnson
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: