Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    setShowValueOnHover for FacetCharts' extra axis metrics

    Hi Isomorphic.

    I am trying to show the extra-axis metrics values when hovering over their respective lines on a FacetChart, but I can't seem to be able to get the desired result, which is to see the value for all series (main and extra axes) when I hover near their respective data points:

    Click image for larger version

Name:	HoverValueTags.png
Views:	49
Size:	72.5 KB
ID:	238898

    When I use setShowValueOnHover(true) only on the chart, the values tags are correctly displayed when hovering over the chart's main data series. But when I add this same method call to the extra-axis settings, the additional data tags won't show, and only the main series value gets a hover tag (see image above). If I remove the method call from the chart and leave it only for the extra axes, the tag is only shown for the first extra axe. So the question is if this the expected behavior: only one axe can get the showValueOnHover setting set to true? Or is there any way to get hover tags for all my axes (main and extra)?

    Please see this test case, based on this demo:

    TestCases.java
    Code:
    public class TestCases implements EntryPoint {  
      
        public void onModuleLoad() {          
            FacetChart chart = new FacetChart();  
            chart.setWidth(600);  
            chart.setHeight(400);  
            chart.setChartType(ChartType.COLUMN);  
            chart.setStacked(true);  
            chart.setValueTitle("Percent");  
            chart.setBorder("1px solid black");  
            chart.setShowTitle(false);  
            chart.setShowChartRect(true);  
            [B]chart[/B][B].setShowValueOnHover(true);[/B]
      
            Facet areaFacet = new Facet();  
            areaFacet.setValues(new FacetValue("1", "North America"));  
            areaFacet.setId("area");  
            Facet metricFacet = new Facet();  
            metricFacet.setValues(new FacetValue("percent", "Percent"),  
                                  new FacetValue("events", "Events"),  
                                  new FacetValue("throughput", "Throughput"));  
            metricFacet.setInlinedValues(true);  
            metricFacet.setId("metric");  
      
            chart.setFacets(new Facet("date"), areaFacet, metricFacet);  
            chart.setExtraAxisMetrics("events", "throughput");  
            MetricSettings metricSettingsEvents = new MetricSettings();  
            metricSettingsEvents.setChartType(ChartType.LINE);  
            metricSettingsEvents.setMultiFacet(true);  
            metricSettingsEvents.setShowDataPoints(true);  
            metricSettingsEvents.setValueTitle("Events");
          [B]  metricSettingsEvents.setShowValueOnHover(true);[/B]
            MetricSettings metricSettingsThroughput = new MetricSettings();  
            metricSettingsThroughput.setChartType(ChartType.AREA);  
            metricSettingsThroughput.setMultiFacet(true);  
            metricSettingsThroughput.setShowDataPoints(true);  
            metricSettingsThroughput.setValueTitle("Throughput");  
           [B] metricSettingsThroughput.setShowValueOnHover(true);[/B]
            chart.setExtraAxisSettings(metricSettingsEvents, metricSettingsThroughput);  
      
            chart.setData(ThreePlusAxesChartData.getData());  
      
            HStack layout = new HStack();  
            layout.addMember(chart);  
            layout.draw();  
        }
    }
    ThreePlusAxesChartData.java
    Code:
    public class ThreePlusAxesChartData extends Record {  
      
        public ThreePlusAxesChartData(String area, String date, float percent, int events, int throughput) {  
            setAttribute("area", area);  
            setAttribute("date", date);  
            setAttribute("percent", percent);  
            setAttribute("events", events);  
            setAttribute("throughput", throughput);  
        }  
      
        public static ThreePlusAxesChartData[] getData() {  
            return new ThreePlusAxesChartData[] {  
                new ThreePlusAxesChartData("1", "13 Sep 12", 0.55f, 8751, 20),  
                new ThreePlusAxesChartData("2", "13 Sep 12", 0.32f, 3210, 24),  
                new ThreePlusAxesChartData("3", "13 Sep 12", 0.21f, 2071, 28),  
                new ThreePlusAxesChartData("1", "14 Sep 12", 0.49f, 6367, 30),  
                new ThreePlusAxesChartData("2", "14 Sep 12", 0.41f, 3771, 36),  
                new ThreePlusAxesChartData("3", "14 Sep 12", 0.22f, 2166, 39),  
                new ThreePlusAxesChartData("1", "15 Sep 12", 0.7f, 6011, 41),  
                new ThreePlusAxesChartData("2", "15 Sep 12", 0.19f, 1950, 45),  
                new ThreePlusAxesChartData("3", "15 Sep 12", 0.25f, 2375, 48),  
                new ThreePlusAxesChartData("1", "16 Sep 12", 0.47f, 9234, 51),  
                new ThreePlusAxesChartData("2", "16 Sep 12", 0.25f, 4321, 55),  
                new ThreePlusAxesChartData("3", "16 Sep 12", 0.3f, 909, 59),  
                new ThreePlusAxesChartData("1", "17 Sep 12", 0.3f, 6144, 54),  
                new ThreePlusAxesChartData("2", "17 Sep 12", 0.44f, 4077, 50),  
                new ThreePlusAxesChartData("3", "17 Sep 12", 0.06f, 1477, 52),  
                new ThreePlusAxesChartData("1", "18 Sep 12", 0.7f, 8502, 48),  
                new ThreePlusAxesChartData("2", "18 Sep 12", 0.29f, 3061, 44),  
                new ThreePlusAxesChartData("3", "18 Sep 12", 0.22f, 2955, 42),  
                new ThreePlusAxesChartData("1", "19 Sep 12", 0.45f, 7020, 53),  
                new ThreePlusAxesChartData("2", "19 Sep 12", 0.22f, 3040, 59),  
                new ThreePlusAxesChartData("3", "19 Sep 12", 0.31f, 2177, 53),  
                new ThreePlusAxesChartData("1", "20 Sep 12", 0.69f, 6712, 48),  
                new ThreePlusAxesChartData("2", "20 Sep 12", 0.21f, 4981, 42),  
                new ThreePlusAxesChartData("3", "20 Sep 12", 0.12f, 1234, 45),  
                new ThreePlusAxesChartData("1", "21 Sep 12", 0.6f, 9321, 48),  
                new ThreePlusAxesChartData("2", "21 Sep 12", 0.29f, 6532, 49),  
                new ThreePlusAxesChartData("3", "21 Sep 12", 0.35f, 6622, 45),  
                new ThreePlusAxesChartData("1", "22 Sep 12", 0.37f, 8389, 48),  
                new ThreePlusAxesChartData("2", "22 Sep 12", 0.35f, 5104, 51),  
                new ThreePlusAxesChartData("3", "22 Sep 12", 0.3f, 5111, 55),  
                new ThreePlusAxesChartData("1", "23 Sep 12", 0.4f, 7555, 49),  
                new ThreePlusAxesChartData("2", "23 Sep 12", 0.34f, 2345, 52),  
                new ThreePlusAxesChartData("3", "23 Sep 12", 0.16f, 3456, 57),  
                new ThreePlusAxesChartData("1", "24 Sep 12", 0.62f, 9567, 60),  
                new ThreePlusAxesChartData("2", "24 Sep 12", 0.12f, 5678, 55),  
                new ThreePlusAxesChartData("3", "24 Sep 12", 0.37f, 6789, 51)  
            };  
        }  
    }
    Thanks in advance for any guidance/help on solving this issue.

    SmarGWT 6.0p 2016-06-22.

    #2
    For anyone interested, this seems to not be an error, but be the expected behavior, according to this.

    Isomorphic, how would you recommend going about this specific objective of showing labels for all axes? Which overrides do you suggest to implement?

    Thanks again!

    Comment

    Working...
    X