JQPlot stacked bar each stacked label count instead of accumulation (incremental) count

后端 未结 4 431
不知归路
不知归路 2021-01-12 20:17

I want to display label text in stead of segment total for each label.

Like, 2, 7, 14 should be in stacked bar with 2, 7, 14 and then 23 is total. But currently in e

4条回答
  •  春和景丽
    2021-01-12 20:27

    On the summation issue: You've stumbled across a jqplot bug.

    If you'll open jqplot.pointLabels.js, take a look at the code starting around line 172/173:

    var d = this._plotData;
    

    If you'll update it to read

    var d = this._plotData; 
    if (p.stackSeries) {
        var d = this.data;
    }
    

    When you call the chart, use something similar to this in your series options:

    pointLabels: { show: true, stackedValue: false, stackSeries: true }
    

    You'll be able to use the PointLabels stackedValue attribute to turn off the stacked summing.

    The fix for the stackedValue bug is detailed here.

    jmva answered your question regarding label placement.

提交回复
热议问题