Announcement

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

    Format values interval in facechart

    1.SmartClient Version 8.3
    2.Google Chrome

    Hi, I had create a facetchart and I facing problem with format the Y-axis value by setting its interval. Currently it automatic set the interval value by 10 based on my data, but I wan set interval by 50 for the Y-axis. How to do this? here is my code:

    Code:
    isc.FacetChart.create({
        ID: "YieldAndDefectiveAnalysisByPONumberChart",
        width: "100%",
        height: "100%",
        chartType: "Column",
        stacked: true,
        valueProperty: "percent",
        showValueOnHover: true,
        updateData: function (dynamicCriteria) {
            var self = this;
            YieldAndDefectiveAnalysisByPONumberFetchDS.fetchData(
             dynamicCriteria,
              function (dsResponse, data, dsRequest) {
                  self.setData(data);
              }
            );
        },
        facets: [
           {
               id: "MachineName"
           },
           {
               id: "area"
           }
        ],
        showShadows: false,
        border: "1px solid black",
        showTitle: false,
        dataMargin: 200,
        dataColors: ["#fffd53", "#f8c14c", "#60ffff", "#97E997", "#F36050", "#7F62B4"],
        chartBackgroundDrawn: function () {
            var values = this.getFacetData().getProperty(["percent"]);
            var sum = 0;
    
            for (var i = 0, l = values.length; i < l; i++) {
                sum = sum + parseFloat(values[i]);
            }
            avgLineY = this.getYCoord(sum / l);
    
            isc.DrawLine.create({
                drawPane: this,
                startPoint: [this.getChartLeft(), avgLineY],
                endPoint: [this.getChartLeft() + this.getChartWidth(), avgLineY],
                autoDraw: true
            }, {
                lineWidth: 4,
                lineColor: "red",
                linePattern: "solid"
            });
        },
        barProperties: {
            click: function () {
                var a = YieldAndDefectiveAnalysisByPONumberChart.getNearestDrawnValue(YieldAndDefectiveAnalysisByPONumberChart.getOffsetX(), YieldAndDefectiveAnalysisByPONumberChart.getOffsetY());
                LoadYieldAnalysisByDay(a.facetValues.MachineName);
    
            }
        }
    });
    Hope someone can help, thanks in advanced.
Working...
X