Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 exmaple it is showing segment total - first bar is empty and then 2, 2+7=9, and total = 23 (9+14).

JQ Plot shows (stacked bar column graph - 3rd graph): http://www.jqplot.com/tests/bar-charts.php

I want like this url like highchart for label count see example: http://www.highcharts.com/demo/column-stacked

Please let me know if I can go with solution then it would be great help...

like image 722
k-s Avatar asked Dec 22 '11 13:12

k-s


1 Answers

I have a solution for it as it seems that independent of the value of the stackedValue parameter the values of the stacked bars are always summed up.

My solution to this problem involved:

  • adding of one more series which serves as the sum, the values you fill it with are all the same (i.e. 3) as their only role is to position the labels,

  • making the last series (5th) invisible and its shadow nearly transparent,

  • and using the labels on each series directly rather than letting the script decide what to put there, otherwise it would obviously sum up the values.

My solution could be found here.


EDIT

I have recently spotted that there already was a solution for this problem available here.

like image 61
Boro Avatar answered Sep 21 '22 02:09

Boro