Announcement

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

    FacetChart bug: data values aren't always shown

    SmartClient Version: SNAPSHOT_v12.0d_2018-03-07/AllModules Development Only (built 2018-03-07)
    and
    SmartClient Version: v11.1p_2018-03-07/AllModules Development Only (built 2018-03-07)

    Chrome on OSX

    Hello, please try the #simpleChart sample modified like that:

    Code:
    var chartData = [
        {region: "West", sales: 2},
        {region: "North", sales: 1},
        {region: "East", sales: 3},
        {region: "South", sales: 0}
    ]
    
    isc.FacetChart.create({
        ID: "simpleChart",
        facets: [{
            id: "region",
            title: "Region"
        }],
        data: chartData,
        valueProperty: "sales",
        chartType: "Doughnut",
        showDataValues: true,
        showTitle: false,
        showShadows: false,
        useAutoGradients: false,
        showLegend: false,
        showValueOnHover: false,
        showContextMenu: "false"
    });
    
    isc.DynamicForm.create({
        ID: "chartSelector",
        items: [{
            name: "chartType",
            title: "Chart Type",
            type: "select",
            valueMap: ["Area", "Column", "Bar", "Line", "Pie", "Doughnut", "Radar"],
            defaultValue: "Doughnut",
            changed : function (form, item, value) {
                simpleChart.setChartType(value)
            }
        }]
    });
    chartSelector.observe(simpleChart, "setChartType", "chartSelector.getItem('chartType').setValue(simpleChart.chartType)");
    isc.VLayout.create({
        ID: "simpleChartLayout",
        width: "100%",
        height: "100%",
        membersMargin: 20,
        members: [chartSelector, simpleChart]
    });
    You'll see that it won't display the data values, because there's a value which is zero, so obviously there isn't enough space to show it.
    But actually in this case I was expecting to see them, as it's the case when the value is null instead of zero.
    Last edited by claudiobosticco; 8 Mar 2018, 00:38.

    #2
    We're not seeing an issue running your test case; 0 appears where expected in eg column charts. Please show a screenshot of whatever it is you're seeing.

    Comment


      #3
      Sorry, I forgot to mention that the problem is with chart types like Doughnut and Pie, ie:

      Click image for larger version

Name:	2018-03-08 17.04.32.jpg
Views:	124
Size:	20.3 KB
ID:	252144

      Comment


        #4
        How are you expecting a value of 0 to appear in a Doughtnut chart? Showing no slice would seem to be the correct representation.

        Comment


          #5
          Yes, it is.
          But I was referring to the data values, which are normally shown on the slices (when showDataValues=true).
          In this case they aren't shown, I think because, as the docs says:
          data values will be shown unless the data density is high enough that labels will potentially overlap, in which case, data values will not be shown and hovers will be shown instead
          But considering that the slice representation doesn't exist at all, I was hoping that the other slices showed their values nevertheless.

          Comment


            #6
            We've applied a fix for this in SC 11.1p and newer releases so that 0-value slices are skipped completely when we check whether there's space for data labels. That should yield the desired behavior of avoiding hover labels in your repro case. This will be in the nightly builds dated 2018-03-10 and beyond.

            Comment


              #7
              SmartClient Version: v11.1p_2018-03-11/AllModules Development Only (built 2018-03-11)

              I can confirm it's fixed, thank you very much.

              Comment

              Working...
              X