Reksio Report post Posted March 3, 2018 (edited) Hello, I have several stackedbar2d with very different values. In the bars have to be a text with also the value of the bar. For the position of the text I have this line: "x": "$dataset.1.set.0.X - 90", in the script for the stackedbar2d. The number of the x-position I have to change by every value of the bar length, otherwise the text is not on the same position in display. Is there any solution for this problem? Maybe by an calculation with the whole length of both bars in pixel and a constant? Here is an fiddle example for that. first chart: "groups": [ { "id": "Callout", "items": [ { "id": "CalloutLabel0", "type": "Text", "fontSize": "12", "bold": "0", "fillcolor": "#333", "text": "N=164 MW=5.8", "align":"left", "x": "$dataset.1.set.0.X - 200", "y": "$dataset.0.set.0.starty + 10" }, $dataset.1.set.0.X - 200 in the chart below: $dataset.1.set.0.X - 320 if both has $dataset.1.set.0.X - 320 then you have this result here. (please use chrome browser for fiddle maybe) Edited March 3, 2018 by Reksio Share this post Link to post Share on other sites
Reksio Report post Posted March 5, 2018 (edited) Maybe there is no developer who wants or can or both to reply to this question or is it not comprehensible? Actually I only need the name of the property for the whole length of both horizontal bars. Edited March 5, 2018 by Reksio Share this post Link to post Share on other sites
Akash Biswas Report post Posted March 6, 2018 Hi Reksio, In your implementation of annotations in StackedBar chart is not utilizing the macros optimally, because you are placing the annotation texts on the first dataset(Grey - #D9D9D9), but you are setting the macro in "x" attribute with respect to the second dataset(Green or Red) as below : "x": "$dataset.1.set.0.X - 320", which is not a proper implementation. You need to set the macros in the "x" attribute with respect to the dataset and set(plots) on which you are displaying the annotations. This will help you to align them all using the same padding with the macros for the respective annotations. Refer to the code below : Plot 1 - "x": "$dataset.0.set.0.STARTX+30", Plot 2 - "x": "$dataset.0.set.1.STARTX+30", Plot 3 - "x": "$dataset.0.set.2.STARTX+30", Plot 4 - "x": "$dataset.0.set.3.STARTX+30", Plot 5 - "x": "$dataset.0.set.4.STARTX+30", Also find a Sample fiddle for reference : http://jsfiddle.net/1t8bv9cb/ Thanks, Akash. Share this post Link to post Share on other sites
Reksio Report post Posted March 8, 2018 On 6.3.2018 at 8:59 AM, Akash Biswas said: Hi Reksio, In your implementation of annotations in StackedBar chart is not utilizing the macros optimally, because you are placing the annotation texts on the first dataset(Grey - #D9D9D9), but you are setting the macro in "x" attribute with respect to the second dataset(Green or Red) as below : "x": "$dataset.1.set.0.X - 320", which is not a proper implementation. You need to set the macros in the "x" attribute with respect to the dataset and set(plots) on which you are displaying the annotations. This will help you to align them all using the same padding with the macros for the respective annotations. Refer to the code below : Plot 1 - "x": "$dataset.0.set.0.STARTX+30", Plot 2 - "x": "$dataset.0.set.1.STARTX+30", Plot 3 - "x": "$dataset.0.set.2.STARTX+30", Plot 4 - "x": "$dataset.0.set.3.STARTX+30", Plot 5 - "x": "$dataset.0.set.4.STARTX+30", Also find a Sample fiddle for reference : http://jsfiddle.net/1t8bv9cb/ Thanks, Akash. THANK YOU very much, Akash. Share this post Link to post Share on other sites
Akash Biswas Report post Posted March 9, 2018 Welcome Reksio Regards, Akash. Share this post Link to post Share on other sites