FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Aug 23, 2016, 11:54 AM
94 Posts

can you use hover text instead?

  • Category: Dojo and Client Side JavaScript
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: DOJO Charts,Clustered column charts,Format series data
  • Replies: 1

I'm displaying data in hover text for each bar like this:  (note that my numbers need some better formatting, though!)

Here's the tool tip snippet from my page - seriestt is an array of x-axis labels...

    var axis1 = seriestt;
    var statval = '#{javascript:sessionScope.StatValue}';
    if(statval=="Dollars"){
        var pattern = "<strong>{0}</strong><br>{1}:&nbsp;&#36;{2}";   //&#36 = $
    }
    else {
        var pattern = "<strong>{0}</strong><br>{1}:&nbsp;{2}";
    }
    var myTooltip = new dojox.charting.action2d.Tooltip(chart2, "default",
        {text: function(o){return dojo.replace(pattern, [o.run.name, axis1[o.index], o.run.data[o.index]]); }});

 

where statval is either Dollars or Hours (so, either show a $ sign or not)


FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.